powertips

Waiting for a Keystroke

All PowerShell versions, PowerShell Console only To keep the PowerShell console open when a script is done, you may want to add a “Press Any...

read more

Finding Errors in Scripts

All PowerShell Versions It’s never been easier to find scripts with syntax errors in them. Just use this filter: filter Test-SyntaxError {...

read more

Discarding Results

All PowerShell Versions Since PowerShell returns anything that commands leave behind, it is particularly important in PowerShell scripts to discard...

read more

Important Math Functions

All PowerShell Versions Here are the four most important Math functions needed by administration scripts: [Math]::Floor(4.9) [Math]::Ceiling(3.2)...

read more

Combining Results

All PowerShell Versions Let's assume you want to identify suspicious service states like services that are stopped although their start mode is...

read more

Countdown Hours

All PowerShell Versions Whether it is a birthday or an important game, you may want PowerShell to tell you just how many hours it is till the event...

read more

Playing WAV Sounds

PowerShell 3.0 or later To play a WAV sound file in a background process, PowerShell can use the built-in SoundPlayer class. It accepts a path to a...

read more

System Uptime

All PowerShell Versions Windows starts a high definition counter each time it boots, and this counter will return the milliseconds the system runs:...

read more

WMI Device Inventory

All PowerShell Versions The WMI service can report plenty of details about the computer hardware. Typically, each type of hardware is represented by...

read more
1 63 64 65 66 67 122