Powershell

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

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

Foreach -parallel (Part 3: Mass Ping)

In PowerShell 7, there is a new parallel ForEach-Object that can execute code in parallel and speed up things considerably. The same technique can...

1 13 14 15 16 17 104