PowerShell Cheatsheet

PowerShell cmdlets, pipeline patterns, and scripting reference with examples

The PowerShell cheatsheet covers essential cmdlets, pipeline patterns, file operations, string manipulation, error handling, and scripting idioms. Search by cmdlet name or description and copy any example with one click.

How to Use This PowerShell Cheatsheet

PowerShell is a cross-platform task automation framework with a powerful cmdlet system. Cmdlets follow Verb-Noun naming (Get-Process, Set-Content, Remove-Item), making commands intuitive and discoverable.

Cmdlet Naming Convention

All cmdlets use approved verbs: Get (read), Set (change), New (create), Remove (delete), Start, Stop, Test, Invoke. Combine with nouns: Process, Item, Content, Service, User. Use Get-Verb to see all approved verbs and Get-Command to find any cmdlet.

The Pipeline

PowerShell passes objects, not text. Get-Process | Where-Object {$_.CPU -gt 100} — the $_ is the current pipeline object. Select-Object picks properties, Sort-Object sorts, ForEach-Object iterates.

Getting Help

PowerShell has excellent built-in help: Get-Help Get-Process -Full shows complete documentation. Get-Help Get-Process -Examples shows examples only. Get-Command *process* finds all process-related cmdlets.

Frequently Asked Questions

Is this PowerShell cheatsheet free?

Yes, completely free with no signup. Search and copy any cmdlet example.

What is the difference between PowerShell and Command Prompt?

PowerShell is an object-based automation framework built on .NET. Unlike Command Prompt which deals with text, PowerShell cmdlets pass objects through the pipeline — you can access properties and methods directly. PowerShell 5.x ships with Windows, PowerShell 7+ is cross-platform and open-source.

How do I run a PowerShell script?

Run .ps1 files with: .\script.ps1 in PowerShell. By default execution policy blocks scripts. Set-ExecutionPolicy RemoteSigned allows local scripts. For CI/CD use -ExecutionPolicy Bypass when launching powershell.exe. Never use Unrestricted on production systems.

What is the PowerShell pipeline?

The pipeline (|) passes output objects from one cmdlet to the next. Unlike bash which passes text, PowerShell passes live objects with properties. Example: Get-Process | Where-Object {$_.CPU -gt 100} | Select-Object Name, CPU — filters processes by CPU then selects only Name and CPU properties.

How do I install PowerShell modules?

Use Install-Module from PowerShell Gallery (PSGallery): Install-Module -Name ModuleName -Scope CurrentUser. Find modules with Find-Module 'keyword'. See installed modules with Get-Module -ListAvailable. Import into session with Import-Module ModuleName.