The Win32_LogicalDevice WMI class represents all logic devices available in a computer, and by querying this “superclass”, you get back all the...
ps1
Adding New PowerShell Commands with Carbon
Carbon is one of the most popular free PowerShell modules available from the PowerShell Gallery. Similar to a swiss army knife, it comes with a...
Managing Updates with PSWindowsUpdate
There are many useful PowerShell modules available from the PowerShell Gallery. One helps you managing updates. To download and install it, run:...
Dynamic Argument Completion (Part 5)
In our previous tip we looked at sophisticated completion code that completed application paths. Collecting the completion values could take some...
Dynamic Argument Completion (Part 4)
In the previous tip we explained how you can use [ArgumentCompleter] to add powerful argument completers for parameters. There are limitations...
Dynamic Argument Completion (Part 3)
With the discoveries in our past tips, let’s compose a useful completion code that suggests all available programs you can launch: function...
Dynamic Argument Completion (Part 2)
In our previous tip we looked at [ArgumentCompleter] and how this attribute can add clever code to parameters that provides auto-completion values...
Dynamic Argument Completion (Part 1)
In previous tips we explained various ways of adding argument completers to your parameters. One approach used the [ArgumentCompleter] attribute and...
Listing Installed Applications (Part 2)
In the previous tip we read the registry to find out paths to applications you can launch. This approach worked well but had two flaws: first, the...
Listing Installed Applications (Part 1)
Ever wondered what the path is to launch a given application? The Windows registry has a key that stores such information: $key =...
Secret Dynamic Argument Completer
In the previous tip we introduced the lesser-known “ArgumentCompletion” attribute that can provide IntelliSense-like autocompletion to parameters....
Creating Colorful Console Hardcopies
If you’d like to hardcopy the content of a PowerShell console, you can copy and select the text, but this messes up colors and formatting. A better...
Understanding $ErrorView
When PowerShell encounters a problem, it displays a rather lengthy error message: PS> 1/0 Attempted to divide by zero. At line:1 char:1 + 1/0 +...
IntelliSense for Parameters (Part 4)
Wouldn’t it be nice if parameters would suggest valid arguments for the user? Sometimes they do. When you type below command and press a SPACE after...
IntelliSense for Parameters (Part 3)
Wouldn’t it be nice if parameters would suggest valid arguments for the user? Sometimes they do. When you type below command and press a SPACE after...
IntelliSense for Parameters (Part 2)
Wouldn’t it be nice if parameters would suggest valid arguments for the user? Sometimes they do. When you type below command and press a SPACE after...
IntelliSense for Parameters (Part 1)
Wouldn’t it be nice if parameters would suggest valid arguments for the user? Sometimes they do. When you type below command and press a SPACE after...
Separating IPv4 and IPv6
Let’s assume you want to return IP addresses from all network cards but separate them by address type. Here is an approach that uses solely...
Installing and Test-Driving Windows Terminal
Windows Terminal is a new multi-tabbed tool for console-based shells. It is officially available via the Microsoft Store and currently requires...
Installing Free Chocolatey Package Management
Chocolatey is a package management system that helps you download and install software packages. Unlike the PowerShell Gallery, Chocolatey is not...
Grab Original PowerShell Language Specification
The PowerShell team has once published the rich and detailed PowerShell 3 language reference, and since the core language never changed, this...
Downloading PowerShell Language Reference (or any file)
Invoke-WebRequest can easily download files for you. The code below downloads the PowerShell Language Reference published by PowerShell Magazine,...
Sharing Modules in Windows PowerShell and PowerShell Core
Many PowerShell users start to take a look at PowerShell 7, and run it side-by-side to the built-in Windows PowerShell. Both PowerShell versions...
Installing ActiveDirectory Module
Good news for any PowerShell users dealing with Active Directory: in recent Windows 10 builds (Enterprise, Professional), Microsoft included the...