PowerShell Commands

PowerShell commands cheatsheet.

Files, pipelines, processes and services — the PowerShell cmdlets you'll use most. Tap to copy.

Files & folders
Get-ChildItemList items in a folder (alias: ls, dir)
Set-Location <path>Change directory (alias: cd)
New-Item -ItemType Directory <name>Create a new folder
Copy-Item <src> <dst>Copy a file or folder
Move-Item <src> <dst>Move or rename an item
Remove-Item <path>Delete a file or folder
Get-Content <file>Print a file's contents (alias: cat)
Finding & filtering
Select-String "text" <file>Search for text in files (like grep)
Get-ChildItem -Recurse -Filter *.logFind files recursively by pattern
Get-Process | Where-Object CPU -gt 100Filter objects in a pipeline
Get-ChildItem | Sort-Object Length -DescendingSort pipeline output
Processes & services
Get-ProcessList running processes (alias: ps)
Stop-Process -Name <name>Stop a process by name
Get-ServiceList Windows services
Start-Service <name>Start a service
Restart-Service <name>Restart a service
System & help
Get-Help <command>Show help for a command
Get-Command *item*Find commands by name
$PSVersionTableShow the PowerShell version
Set-ExecutionPolicy RemoteSignedAllow local scripts to run

Verb-Noun makes commands guessable

PowerShell's defining idea is that every command follows a Verb-Noun pattern — Get-ChildItem, Stop-Process, Set-Location — which makes the language unusually discoverable: once you know the verbs (Get, Set, New, Remove, Start, Stop), you can often guess a command before looking it up. Familiar aliases like ls, cd and cat map to these cmdlets, so you can start with what you know from other shells and learn the real names gradually.

The pipeline passes objects, not text

The thing that sets PowerShell apart from bash is that its pipeline carries objects, not plain text. That means you can pipe results into Where-Object to filter by a real property and Sort-Object to order by one, without fragile text parsing. For example, listing processes and filtering to the memory-hungry ones is a clean one-liner. Select-Object picks the columns you want, and ForEach-Object runs an action on each item — the building blocks of most useful scripts.

Help is built in

When you're unsure how a command works, Get-Help <command> -Examples shows real usage, and Get-Member piped onto any object reveals every property and method available on it — the fastest way to discover what you can filter or select by. Between Get-Help and Get-Member you can explore PowerShell without leaving the terminal. These complement the Windows shortcuts and the cross-platform Linux commands.

FAQ

How do I search for text in files in PowerShell?
Use Select-String "text" <file>, the PowerShell equivalent of grep. Add -Path with a wildcard to search many files.
Why won't my PowerShell script run?
By default script execution is restricted. Run Set-ExecutionPolicy RemoteSigned (in an admin window) to allow local scripts to run.

More cheatsheets