Powershell

Reading RunOnce Key

The RunOnce key in the Windows Registry stores all auto-starting executables. It may be empty. To check for auto-starting applications, try this:...

Creating Random Passwords

Here is another small script to produce random passwords consisting of a defined number of capitals, letters, numbers, and special characters:...

Converting PowerShell to Batch

Here is a fun PowerShell function called Convert-PowerShellToBatch. Provide it with the path to a PowerShell script, or pipe in the results from...

Piping Files and Folders

Let’s assume you want to create a function that accepts a file path. There are numerous tasks that can be done with files. You may want to...

Simple WMI Browser

WMI is a powerful information repository – if you know the names of WMI classes: Get-CimInstance -ClassName Win32_BIOS Get-CimInstance...

Finding Nested AD Group Memberships

The following code finds all groups a given Active Directory user is member of (including nested group memberships). The code requires the...

Checking Network Connections

If your machine is connected to the internet (or VPN) via different network connections, depending on where you are, then the following two...

Removing Bloatware from Windows 10

Windows 10 comes with all kinds of preinstalled apps and other features that may feel annoying to some. Richard Newton has created a PowerShell...

Managing FTP via PowerShell

There are no built-in FTP commands in PowerShell, but you can easily download and install a free extension that provides the missing commands. Just...

Formatting Numbers (Part 2)

In the previous tip we introduced the Get-DisplayFileSize function which automatically converts bytes to readable numbers with units such as “KB”...

Formatting Numbers (Part 1)

The following Get-DisplayFileSize function takes any byte value and returns a nicely formatted size, using units like “MB”, “GB”, or “PB”: function...

Filtering Files

You may not have noticed this, but the -Filter parameter on Get-ChildItem (aka dir or ls) is not as specific as you think. The following line should...

Remove User Profiles Via Dialog

We’ve received massive feedback on our tips dealing with user profile management, so we decided to add a couple of additional tips. In the...

Find User Profiles

We’ve received massive feedback on our tips dealing with user profile management, so we decided to add a couple of additional tips. Typically,...

List User Profiles

We've received a massive feedback on our tips dealing with user profile management, so we decided to add a couple of additional tips. WMI can...

Understanding and Avoiding Double-Hop

When a script is executed remotely, you can run into “Access Denied” issues that often are related to the double-hop issue. Here is an...

Converting Numeric Strings

Converting a string that contains a number is trivial in PowerShell: PS C:\> [double]"77.234" 77,234 PS C:\> If the string contains...

Using Default Parameter Values

You may have heard about PowerShell default parameter values and $PSDefaultParameterValues. When you assign a hash table to this special variable,...

Binding Parameters by Data Type

PowerShell can automatically bind values to parameters by data type matching. Here is a sample that shows what benefit this can be. Simply run this...

1 28 29 30 31 32 104