database-tools

Creating ISO Files

PowerShell can turn regular folders into ISO files. ISO files are binary files that can be mounted and then behave like a read-only CD-ROM drive. In...

Automating Defender Antivirus (Part 2)

On Windows, PowerShell comes with cmdlets to automate the built-in antivirus engine “Defender”. In this second part, let’s take a look at how you...

Converting Wavelength to RGB

PowerShell is a generic script language so you can do all kinds of stuff with it. Below is a function that takes a light wavelength and converts it...

Querying Advanced Printer Info via SNMP

Many network printer support SNMP to query information about the device, i.e. its serial number, the status and paper sizes of installed trays, or...

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

When you copy multiple lines of PowerShell code and paste them into a shell window, the result often is not what you expect. PowerShell starts...

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...

Analyze blocking for SQL Server

Blocking is a normal activity that occurs in SQL Server and it does that to control data integrity and make sure only one resource can change a set...

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...