Not all PowerShell cmdlets ship with PowerShell. Many are part of 3rd party modules which in turn ship when you install certain software, or use...
powertips
Checking Cmdlet Availability and Script Compatibility (Part 2)
Not all PowerShell cmdlets ship with PowerShell. Many are part of 3rd party modules which in turn ship when you install certain software, or use...
Checking Cmdlet Availability and Script Compatibility (Part 1)
Not all PowerShell cmdlets ship with PowerShell. Many cmdlets are part of 3rd party modules which in turn ship when you install certain software, or...
Colorful ASCII-Art from Images
In the previous tip we showed you how you can take any image or photo and turn it into a black&white ASCII art. Today, we have a revised...
Testing Raw Data with Checksums – A Real-World Example
With PowerShell entering the IoT world, sometimes it is necessary to deal with binary sensor data and ancient checksum models to verify data...
Inverting Bits
Occasionally it is necessary to invert the bits for a number. Most often, this is part of custom algorithms or checksum calculations. It raises the...
Calculating Most and Least Significant Byte
Numbers are stored internally as bytes. An Int32 value, for example, uses four bytes. Sometimes it is required to split up the number into its byte...
Accepting Parameters without Quotes
In the previous tip, we introduced a function that generates nicely centered headers and accepted a single string. Here is the function and its...
Creating Aligned Headers
Reporting and writing log files is a common task in PowerShell. Here is a simple function to create nicely centered headers. Adjust $width to the...
Computer Name, DNS Name, and IP Address
Here is a simple one-liner that returns your computers’ current IP address and its full DNS name: PS>...
Managing Windows License Key (Part 4)
Slmgr.vbs is an ancient VBScript used to automate Windows license management. In the previous tip we started bypassing slmgr.vbs by reading the WMI...
Managing Windows License Key (Part 3)
Most Windows license and activation tasks can be automated using an ancient VBScript called slmgr.vbs. It does not make much sense to use this tool...
Managing Windows License Key (Part 2)
Most automated license key management tasks are done via a command called slmgr. This command is actually an ancient VBScript. To read all of your...
Managing Windows License Key
Let’s start this mini-series with a one-liner that extracts your Windows license key: PS> $key = (Get-WmiObject -Class...
Create ASCII Art
It’s amazing how versatile PowerShell is: with just a couple of lines of code, you can turn any photo and image into a piece of ASCII art....
Verifying Local User Account Passwords
In the previous tip, we asked Active Directory to validate user account passwords. The same can be done with local accounts. Your PowerShell code...
Verifying Domain Account Passwords
PowerShell can easily verify a password against a domain account. In other words, you can bind script logic to passwords maintained in Active...
Waiting for a Service Status Change
Whenever you start or stop a service, it may take some time for the service to actually adopt the desired state – or it can of course fail....
Converting Text to Image
WPF (Windows Presentation Foundation)is not just a technique to create UIs. You can create any type of vector-based graphics composition and save it...
Converting IEEE754 (Float) (Part 2)
Yesterday we looked at how PowerShell can turn IEEE754 floating point values returned by a sensor into the actual value. This involved reversing the...
Converting IEEE754 (Float) (Part 1)
PowerShell is extremely versatile and nowadays often used with IoT and sensors as well. Some return values in IEEE754 float format which typically...
Be Careful With “Throw” Statements (Part 2)
In the previous tip we explained how the throw statement can be influenced by $ErrorActionPreference set to “SilentlyContinue”, and that throw will...
Be Careful With “Throw” Statements (Part 1)
Throw is a PowerShell statement that emits an exception to the caller and then exits the code. At least in theory. In the real world, throw might...
Reading News Feeds
Here’s a special service to users with German language skills – and a challenge to adjust the code for everyone else: the code below...