ps1

Determining Language Packs (Part 1)

Let’s assume you need to find the installed language packs for a Windows machine. In this three-part series, we use PowerShell’s features to tackle...

Running $PSScriptRoot in Selected Code

One of the big pitfalls in PowerShell code is the automatic variable $PSScriptRoot which always holds the path to the folder the current script is...

Pasting Multiple Lines in PowerShell

Unexpected Behavior When Pasting Multiple Lines of PowerShell Code When you copy multiple lines of PowerShell code and paste them into a shell...

Cleaning Up PowerShell Modules (Part 2)

In part 1 we looked at removing PowerShell modules that were originally installed via “Install-Module”. You can as well remove PowerShell modules...

Cleaning Up PowerShell Modules (Part 1)

There are plenty of scripts available that promise to read the original Windows 10 product key from the registry by converting a series of binary...

Using Efficient Lists in PowerShell

By default, PowerShell uses simple “object arrays” when you define lists, when commands return more than one result, or when you otherwise need to...

Out-GridView with Custom Columns

Out-GridView can be a universal dialog when you use the -OutputMode or -PassThru parameters. When you do, a grid view window displays additional...

Converting Ticks to DateTime

Occasionally, date and time information are stored as “Ticks” in the format of a so-called “FileTime”. Ticks are 100-nanosecond units since...

Using BITS to Download Files (Part 1)

What Is BITS (Background Intelligent Transfer System)? BITS (Background Intelligent Transfer System) is the technique used by Windows to download...

Converting File Paths to 8.3 (Part 1)

Why Short Path Names Still Matter Many years ago, file and folder names had a maximum of 8 characters, and these short path names still exist. They...

Updating Help without Admin Privileges

In Windows PowerShell, updating help used to require Administrator privileges due to a design flaw: help had to be stored in the location where the...

Setting and Clearing Trusted Hosts

PowerShell remoting maintains a list of trusted IP addresses and/or machine names on the client side (the machine that issues the command and...

Identifying Antivirus Engine State

In the previous tip you learned how you can query WMI to find out the antivirus product present on your Windows machine: $info = Get-CimInstance...

Speeding Up PowerShell Remoting

PowerShell remoting is insanely powerful: with Invoke-Command, you can send arbitrary PowerShell code to one or many remote machines and execute it...

Identifying Windows Type

WMI returns a cryptic code number of every distinct Windows SKU: PS> Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object...

Launching PowerShell Scripts Invisibly

There is no a built-in way to launch a PowerShell script hidden: even if you run powershell.exe and specify -WindowStyle Hidden, the PowerShell...

Simple PowerShell Chat

Creating a Simple Multi-Channel Chat Room with PowerShell Here’s a fun PowerShell script that you can use to create a simple multi-channel chat...

Converting SecureString to Text

It can be very useful to be able to convert an encrypted SecureString back to a plain text. This way, for example, you can use PowerShell’s “masked...

1 2 3 6