Powershell

Finding 10 Largest Files

You may need to find the largest files for possible clean-up when free space on a drive runs low. One way is to have PowerShell examine all file...

read more

Random Tip of the Day

Get-Random has a dual purpose. It can provide you with a random number and also pick random elements from a collection. So, if you want to get a new...

read more

Sorting Stuff

You can use Sort-Object to sort simple variable types. Have a look at the following: 'Tom', 'Chris', 'Judy', 'Alan'...

read more

Finding Invalid Aliases

When you create new Aliases with Set-Alias, PowerShell does not check whether the target you specify is valid. Instead, this is checked only when...

read more

IPv4 Address Lists

You should try this to get all IPv4 addresses assigned to your system: Get-WMIObject win32_NetworkAdapterConfiguration | Where-Object { $_.IPEnabled...

read more

Generate PC Lists

One easy way of creating lists of PC names or IP address ranges etc is a simple pipeline like this: 1..40 | Foreach-Object {...

read more

Create HTA Files

Another way is to ConvertTo-HTML is a convenient way of converting object results in HTML. However when you open these files, your browser starts...

read more

WMI Server Side Filtering

Whenever you use Get-WMIObject, be sure to minimize resources and maximize speed by using server-side filtering. The next line will use the slow...

read more

List Installed Updates

Using Get-Hotfix is pretty convenient as it serves to list installed updates. Unfortunately, it is not very thorough as it doesn’t retrieve...

read more

Reading Default Values

Each registry key has a default value. It is called (default) when you look into regedit. To read this default value, you can just use this name...

read more

List Installed Software

Get-ItemProperty reads registry values. You can create a software inventory in just one line since it supports wildcards: Get-ItemProperty...

read more

Read Registry Values

You will find that reading Registry values is not always easy because the Registry is accessible only via the generic "drive" paradigm....

read more

Open Explorer

While the PowerShell console is great, it is sometimes just easier to switch to Windows Explorer. Here is the fastest way to open Explorer and show...

read more