PowerShell Cheat Sheet

Searchable reference for everyday PowerShell cmdlets.

CmdletDescription
Get-ChildItemList items (alias: ls, dir)
Set-LocationChange directory (alias: cd)
Get-LocationPrint working directory (alias: pwd)
New-Item -Type Directory pCreate folder
Remove-Item -Recurse -Force pRecursive delete
Copy-Item -Recurse a bCopy folder
Move-Item a bMove / rename
Get-Content <file>Read file (alias: cat)
Select-String 'pat' fGrep equivalent
Get-Process | ? Name -like '*app*'Find process
Stop-Process -Id 1234 -ForceKill process
Get-PSDriveList filesystem-like drives
$env:VAR = 'value'Set env var
Get-Help <cmd>Show help
Invoke-WebRequest -Uri urlHTTP fetch (alias: curl)
ConvertFrom-JsonParse JSON string
ConvertTo-JsonSerialise to JSON
ForEach-Object { ... }Pipeline loop
Where-Object { $_.Foo -eq 1 }Pipeline filter
Select-Object -First 5Take first N
Sort-Object Foo -DescendingSort by property
Measure-Object -LineCount lines
Compress-Archive a -DestinationPath a.zipMake zip
Expand-Archive a.zip -DestinationPath .Extract zip
Test-Path <path>Does it exist?
Get-Command <name>Find a command
Get-MemberInspect object members
Out-File -FilePath f -Encoding utf8Write file as UTF-8
Start-Process -Verb RunAsRun elevated

About this tool

Verb-Noun cmdlets for file system, process, pipeline, archives and HTTP — with one-line descriptions and common aliases.

An unhandled error has occurred. Reload ×