PowerShell cheat sheets

PowerShell is the cheapest way to automate Windows, and most of it fits in one line. These two sheets keep the parts you type most in front of you. Language & syntax covers the grammar everything else is built from: types and operators, pipelines and $_, quotes and here-strings, arrays, hashtables, splatting and the aliases you will meet on every blog. One-liners for sysadmins is a task table with copy-ready commands for disk space, big files, services, processes, networking and event logs.

Every command here is verified against Microsoft Learn documentation and runs as written in Windows PowerShell 5.1 and PowerShell 7.x. Where a cmdlet is Windows-only (the whole Get-Net* and CIM inventory family), the sheet says so — PowerShell 7 on Linux cannot load them. For the two scripts people keep rewriting, the walkthrough versions are in get disk space and list installed software.

Cheat sheets

Free network tools

Subnet CalculatorIPv6 CalculatorWildcard MaskRange → CIDRSplitterAggregatorVLSM CalculatorPracticeCheat Sheet

FAQ

How do I start PowerShell?

Win+R then type powershell.exe for Windows PowerShell 5.1, or pwsh for PowerShell 7. Windows Terminal, now the default on Windows 11, ships both and remembers your choice. The legacy and modern shells run side by side: they can both be installed at once and neither replaces the other.

Which version should I be using?

Use PowerShell 7 for new work: it keeps every core cmdlet, adds better security and is the actively developed shell. Keep in mind the Windows-only modules — the Get-Net* networking cmdlets and every Win32_* CIM class — still require Windows; the language itself, though, is identical. Windows PowerShell 5.1 remains the built-in default on Windows 10/11 and is the version to match when your scripts must run on untouched machines.

Do your commands work on Windows Server?

Yes for the cmdlet rows — CIM, services, processes, Get-WinEvent and the Get-Net* family are Server native, and Get-CimInstance works the same there. The Windows 11 specific items (Storage Sense, the hiberfile behavior of powercfg) live in the maintenance sheet of the Windows hub.

What is the difference between the one-liners sheet and the guides?

The guides are walks. Get disk space and list installed software in the guides section explain the query, the alternatives (Get-PSDrive vs Win32_LogicalDisk, registry vs Win32_Product) and how to export and loop the result. The one-liners sheet is the reference table for paste. Both use the same verified cmdlets.