ps1

Beware of -match

The -match operator is frequently used in scripts however not everyone seems to understand how it really works. It can be a really dangerous filter...

read more

Avoid Add-Member (Part 3)

In the previous tip we looked at a number of clever alternatives to avoid Add-Member when creating your own new objects. While using hash tables to...

read more

Avoid Add-Member (Part 2)

In the previous tip we looked at creating simple data objects, and it became evident that instead of using Add-Member, you can cast a hash table to...

read more

Avoid Add-Member (Part 1)

Often the cmdlet Add-Member is used to create simple objects like this: $user = New-Object -TypeName psobject | Add-Member -MemberType NoteProperty...

read more

Important Keyboard Shortcuts

Two of the most important keyboard shortcuts in any PowerShell environment – whether console, ISE, or VSCode – are TAB and CTRL+SPACE. TAB triggers...

read more

Logging Variable Types

As part of your debugging and quality control you may want to log the data that gets assigned to individual variables. For example, you may want to...

read more

Creating World Map Graphs

If you have data related to countries, you may want to visualize and highlight this geographic data. Classic bar- and chart-graphs won’t always work...

read more

Downloading Files

Simple file downloads can be done in a variety of ways, i.e., using Invoke-RestMethod, Invoke-WebRequest, or via the BitsTransfer module. If you...

read more

Unblocking Multiple Files

When you download files from the internet, or when you copy files from untrusted sources to an NTFS-formatted drive, Windows adds a secret NTFS...

read more