Cheatsheet: PowerShell
Last updated 2026-09-28
Cmdlet Basics & Help
Get help for a cmdlet (with examples)
List commands matching a name or pattern
List every property/method a cmdlet's output has
List available cmdlet verbs
Use a short built-in alias for a cmdlet
Filesystem & Items
List items in the current directory
List items recursively, filtered by name
Change directory
Print working directory
Create a new file or directory
Copy / move / remove an item
Read a file's contents
Test whether a path exists
Pipeline: Filter, Select, Sort
Filter objects by a property condition
Select specific properties
Select the first / last N objects
Sort by a property, descending
Run a script block per pipeline item
Group objects by a property
Measure count/sum/average of a property
Processes & Services
List running processes
Stop a process by name or ID
Start a new process
List services and their status
Start / stop / restart a service
Variables & Scripting
Assign a variable
String interpolation (double quotes only)
If / elseif / else
Comparison operators (not <, >, ==)
Foreach loop over a collection
Define a function with a parameter
Convert pipeline objects to JSON
Remoting & Sessions
Enable PowerShell Remoting on this machine (configures WinRM)
Run a command on a remote machine
Open an interactive remote session
Exit an interactive remote session
Check the current PowerShell version