PowerShell basics
Updated 2026-02-15
PowerShell cmdlets for files, processes, and pipelines. Common aliases and script syntax.
Files and pipeline
Get-ChildItem / dir / lsList items.
Set-Location path / cdChange directory.
Get-Content fileRead file (cat).
|Pipe objects (not text).
Select-Object, Where-ObjectFilter pipeline.
Execution and variables
Run script: .\script.ps1; execution policy Set-ExecutionPolicy. $var = value. $env:PATH. Compare to Bash: -eq, -ne, -lt; -and, -or.