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

PowerShell, the practical bits

PowerShell uses Verb-Noun cmdlets like Get-ChildItem and Stop-Process, many with familiar aliases (ls, cd, cat). Its real power is the pipeline — pass objects into Where-Object and Sort-Object to filter and order results. Use Get-Help on any command for examples.

FAQ

How do I search for text in files in PowerShell?
Use Select-String "text" , 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