Skip to main content
Ganesh Joshi
Back to Cheatsheets

PowerShell basics

Updated 2026-02-15

PowerShell cmdlets for files, processes, and pipelines. Common aliases and script syntax.

Files and pipeline

  • Get-ChildItem / dir / ls

    List items.

  • Set-Location path / cd

    Change directory.

  • Get-Content file

    Read file (cat).

  • |

    Pipe objects (not text).

  • Select-Object, Where-Object

    Filter pipeline.

Execution and variables

Run script: .\script.ps1; execution policy Set-ExecutionPolicy. $var = value. $env:PATH. Compare to Bash: -eq, -ne, -lt; -and, -or.

PowerShell basics | Cheatsheet | Ganesh Joshi