Windows uses the special recents folder to remember which files you have opened. You can have a look to check what Windows has stored: Dir...
database-tools
Bulk-Changing File Extensions
Changing file extensions can be a quick one-line operation. The next line renames all ps1 PowerShell script files found in your user profile and...
Displaying Hex Dumps
PowerShell can read plain text, but it can also read binary content. Here is a little function that creates a "hex dump" of any binary...
Reading File "Magic Number"
File types are not entirely dependent on file extension. Rather, binary files have internal ID numbers called "magic numbers" that tell...
Working with Path Names
The .NET System.IO.Path class has a number of very useful static methods that you can use to extract file extensions. Here is how you can get a list...
Finding A Users Desktop Folder
The .NET Environment class can provide the paths to common folders like a user desktop: Environment]::GetFolderPath("Desktop") Use this...
Writing Your Own Event Log Entries
If you have registered a new event log source, such as "PowerShellScripts" as described in the previous tip, you can now write your own...
Adding New Event Log Sources
Every event log maintains a list of registered sources. You need a source name if you want to write your own event log entries. Make sure you have...
Lowering Process Priority
Sometimes, you may want to lower process priority for some processes. That's a PowerShell one liner. Note that the next line lowers priority for...
Getting Help on WMI Methods
Have you ever wanted to get a list of all WMI methods present inside a specific WMI class – plus a meaningful description and a list of all...
Renewing all DHCP Leases
Some WMI classes contain static methods. Static methods do not require an instance....
Calling ChkDsk via WMI
Some WMI classes contain methods that you can call to invoke some action. For example, the next line initiates a disk check on drive D:...
Getting Help for WMI Classes
In a previous tip, you discovered how to search for WMI classes like Win32_VideoController. Now, what exactly is the purpose of this class? You can...
Finding Interesting WMI Classes
WMI is a huge repository. If you want to get to useful information, you will need to specify the name of a valid WMI class. Fortunately, it is easy...
Rename Drive Label
WMI can also read any drive label (the name that appears next to a drive inside Explorer), and you can change the drive label, too—provided...
Remove Empty Entries
One little known fact is that Where-Object is a cool and simple way of removing empty objects. Let's say you want to list all network adapters...
Finding Your Current Domain
Try this quick and simple way to find out the domain name that you are currently connected: [ADSI]"" The domain name is returned if you...
Retrieving Clear Text Password
Get-Credential is a great way of prompting for credentials, but the Password you enter into the dialog will be encrypted. Sometimes, you may need a...
Use PowerShell Cmdlets!
Whenever possible, try to avoid raw .NET access if you would like to create more readable code. For example, the following line returns the current...
Checking for .NET Framework Version with Powershell
You can use the -contains operator if you need to check whether a specific version of .NET is present on your system: @(dir...
Finding Available .NET Frameworks
Try this if you would like to get a quick overview of all installed .NET framework versions: dir $env:windir\Microsoft.NET\Framework\v* -name It...
Getting Visual Help for PowerShell Cmdlets
Here is a new way of getting help for your PowerShell cmdlets: If you are inside the U.S., try this: http://go.microsoft.com/fwlink/?LinkID=190436...
Secret Timespan Shortcuts
Usually, to create time spans, you will use New-Timespan. However, you can also use a more developer-centric approach by converting a number to a...
Finding Secret Date-Time Methods
However, to use developer-centric date-time methods, you will need to know them first. Here is how: Get-Date | Get-Member -memberType *Method This...