Show Menu
Cheatography

PowerShell Commands Cheat Sheet by

Key PowerShell cmdlets for Windows administration: files, processes, services, networking, and Active Directory basics — with practical examples. Built for Windows admins and certification study. More free study resources at bytebarhq.com.

The Pattern

Every cmdlet is Verb-Noun
Get-Pr­ocess
,
Stop-S­ervice
,
New-Item
Learn the verbs — they work across every noun.

Must-Know Aliases

ls
/
dir
Get-Ch­ildItem
cat
Get-Co­ntent
echo
Write-­Output
ps
Get-Pr­ocess
kill
Stop-P­rocess
cp
Copy-Item
mv
Move-Item
rm
Remove­-Item
man
Get-Help
?
Where-­Object
%
ForEac­h-O­bject
Aliases are shortcuts — use full cmdlet names in scripts.

Files & System

Get-Ch­ildItem -Recurse -Filter *.log
find files
Get-Co­ntent log.txt -Tail 20 -Wait
live tail
Copy-Item src dst -Recurse
copy folders
Get-Help Get-Pr­ocess -Examples
built-in examples
Get-Co­mmand service
discover cmdlets
Get-Help
and
Get-Co­mmand
are your built-in docume­nta­tion.

Processes & Services

Get-Pr­ocess | Sort-O­bject CPU -Desce­nding | Select­-Object -First 5
top 5 CPU hogs
Stop-P­rocess -Name notepad -Force
kill a process
Get-Se­rvice | Where-­Object {$_.Status -eq 'Running'}
running services
Restar­t-S­ervice -Name Spooler
restart a service
The pipe
|
passes objects, not text.

Networking

Test-C­onn­ection 8.8.8.8 -Count 4
ping
Test-N­etC­onn­ection exampl­e.com -Port 443
port check
Get-Ne­tIP­Address
IP config
Get-Dn­sCl­ien­tCache | Clear-­Dns­Cli­ent­Cache
flush DNS
Resolv­e-D­nsName exampl­e.com
nslookup equivalent
Test-N­etC­onn­ection
covers ping, port checks, and traceroute in one cmdlet.

Active Directory

Get-ADUser -Filter * -Searc­hBase "­OU=­Sal­es,­DC=­cor­p,D­C=l­oca­l"
all users in an OU
Get-ADUser jdoe | Unlock­-AD­Account
unlock an account
Set-AD­Acc­oun­tPa­ssword jdoe -Reset
force a password reset
Get-AD­Com­puter -Filter * | Select­-Object Name,O­per­ati­ngS­ystem
inventory computers
Requires the Active­Dir­ectory module (RSAT).

Pipeline Power

Get-Pr­ocess | Sort-O­bject CPU -Desce­nding | Select­-Object -First 5 Name
top 5 CPU hogs, names only
Get-Ch­ildItem C:\ -Recurse -Error­Action Silent­lyC­ontinue | Where-­Object {$_.Length -gt 100MB} | Sort-O­bject Length -Desce­nding
find large files
Chain small cmdlets — the pipeline does the heavy lifting.

Quick Hits

Set-Ex­ecu­tio­nPolicy Remote­Signed -Scope Curren­tUser
unblock scripts
Cmdlets output objects, not text
pipe freely
$_
current object in the pipeline
When in doubt, pipe to
Get-Member
to see what's inside.
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Enumeration Cheat Sheet
          Windows Terminal Cheat Sheet
          Windows Terminal Cheat Sheet

          More Cheat Sheets by bytebar

          Common Network Ports Cheat Sheet
          OSI Model Cheat Sheet