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 +...
posts-powershell
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...
Testing for Pending Reboots
When Windows installed updates or made related changes to the operating system, changes may become effective only after a reboot. While a reboot is...
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...
Killing Non-Responding Processes
Process objects returned by Get-Process can tell whether the process is currently responding to window messages and thus to user requests. This line...
Testing Network Connections (Part 2)
If you’d like to test whether a specific computer or URL is online, for decades ping requests (ICMP) have been used. In recent times, many servers...
Testing Network Connections (Part 1)
PowerShell comes with Test-NetConnection which works like a sophisticated ping tool. In its default, you can ping computers: PS>...
Exploring Plug&Play Devices (Part 4)
In the previous tips we investigated the UPnP.UPnPDeviceFinder and how to identify devices in your network. Let’s look at some use cases. Obviously,...
Exploring Plug&Play Devices (Part 3)
In the previous tip we illustrated how to use the UPnP.UPnPDeviceFinder to find devices on your network. You already learned how to enumerate all...
Exploring Plug&Play Devices (Part 2)
In the previous tip, we used the UPnP.UPnPDeviceFinder to discover smart devices hooked up to your network. Today, let’s take a closer look at...
Exploring Plug&Play Devices (Part 1)
You are probably living already in a connected smart home with many devices hooked up to your network. PowerShell can help you find your devices...
Listing Installed Updates (Part 2)
In the previous tip we looked at how to retrieve the list of currently installed updates from the Windows Update Client. This list can be polished,...
Listing Installed Updates (Part 1)
Get-Hotfix only lists operating-system-related hotfixes: Get-HotFix In reality, it is just a thin wrapper around a WMI query which produces...
Aborting the PowerShell Pipeline (Part 2: Manual Abort)
In the previous tip you learned how to abort the PowerShell pipeline once the required number of results is in, potentially saving a lot of time:...