A PowerShell quick reference for files and processes, with printable command examples.

PowerShell Commands Cheat Sheet for Everyday Work

Start with Get-Command to find a tool, then read its help before running it. This PowerShell quick reference groups safe examples for discovery, files, processes, and pipelines. To keep a printable Windows command reference, use your browser’s print dialog to save this page as a PDF.

Find commands and read help

PowerShell uses a verb-noun naming convention for cmdlets. Get-Command searches commands available on the system; Get-Help explains syntax, parameters, and examples.

Get-Command -Verb Get -Noun Process
Get-Help Get-Process -Examples
Get-Help Get-ChildItem -Parameter LiteralPath

The first line finds a command by verb and noun. The next two show examples and describe one parameter. Local help may be incomplete; Microsoft’s online documentation provides the full reference. Check the applicable version: Windows PowerShell 5.1 and newer PowerShell releases do not necessarily have identical features or installed modules.

This PowerShell commands cheat sheet is a starting point, not a substitute for reading the syntax. A parameter can change the scope of an operation, and a command that looks familiar may resolve to an alias, function, or executable. Use Get-Command with the exact name to inspect the command type and source before relying on it.

Work with objects in a pipeline

A pipeline passes objects between commands, not just the text displayed on screen. The receiving command can use their properties. The following example selects processes by working set and shows a few fields:

Get-Process | Where-Object { $_.WorkingSet64 -gt 100MB } |
    Sort-Object -Property WorkingSet64 -Descending |
    Select-Object -First 5 -Property Name, Id, WorkingSet64

Here $_ is the current object. The filter runs before the sort, and the selection limits the displayed result to five matching processes. The threshold is a convenience for inspection, not a diagnosis of excessive memory use. Results change as processes start, exit, and allocate memory.

To inspect available properties rather than guessing their names, pipe an object to Get-Member. The Microsoft explanation of objects describes how properties travel through a pipeline. Apply formatting commands at the end when producing a display; formatting objects are not a reliable replacement for the original process objects in later processing.

Inspect files and processes

The following PowerShell examples list files in the current directory and inspect a named process. They do not delete files or stop a process.

Get-ChildItem -LiteralPath . -File |
    Select-Object -Property Name, Length, LastWriteTime
Get-Process -Name explorer

-LiteralPath treats the supplied path literally rather than interpreting wildcard characters. -File limits the first listing to files in that directory; it does not recurse into subdirectories. The second command reports matching processes if they exist. A missing process can produce an error, and access permissions can affect what you can inspect. See Microsoft’s references for Get-ChildItem and Get-Process.

A cheat sheet can make destructive actions look deceptively simple. Remove-Item can delete data, while Stop-Process can interrupt work and cause unsaved changes to be lost. For commands that support it, -WhatIf previews intended actions without carrying them out. Inspect the targets and consult the command’s help first; do not assume every command supports that parameter. Microsoft documents its behavior under common parameters.

Windows PowerShell commands PDF: Save a personal copy

For a Windows PowerShell commands PDF, open the browser’s print dialog, choose a PDF destination, and save the page to your preferred location. Review the print preview for clipped code or links. This creates your own copy of the current page; it does not require a separate downloadable attachment.

Before running a command against important data, check:

  • The command name, source, version, and parameter descriptions.
  • The exact path or process targets, including any wildcard expansion.
  • The output of a read-only selection and, where supported, -WhatIf.
  • A suitable backup and a recovery plan for any intended change.