// CyberGrind · Orange Book · OS Infographic Series — 07 of 09

Windows Terminal & PowerShell

cmd.exe legacy commands + PowerShell 7 object-oriented cmdlets — with aliases, flags, and real-world patterns.

Windows PowerShell 7 — Object Pipeline Demo
PS C:\Users\Logan> Get-Process | Where-Object {$_.CPU -gt 10} | Sort-Object CPU -Desc | Select-Object Name,CPU,Id
Name CPU Id
---- --- --
chrome 48.23 3421
Key concept: PowerShell pipes .NET objects — not text strings. Sort-Object CPU sorts numerically on the actual CPU property. No awk/grep needed. cmd.exe works on plain text; PowerShell works on structured data.
// Navigation & File System
Set-Location C:\path
alias: cd, sl
Change working directory. Use cd ~ for home. Use cd - to go back.
Get-ChildItem -Path . -Recurse
alias: ls, dir, gci
List directory. -Filter *.log to filter. -Force to show hidden. -Recurse for all subdirs.
New-Item -ItemType Directory logs
alias: mkdir, md
Create directory or file (-ItemType File). Use -Force to suppress errors if already exists.
Copy-Item src -Destination dst\
alias: cp, copy
Copy file or folder. Add -Recurse for directories. -Force to overwrite existing destination.
Remove-Item file.txt -Force
alias: rm, del
Delete file permanently — no Recycle Bin. -Recurse for directories. -WhatIf to preview.
Get-Content file.txt -Tail 20
alias: cat, type, gc
Print file. -Tail N for last N lines. -Wait for live follow (log tailing). -Encoding for encoding control.
// Search & Filter
Select-String -Pattern "error" *.log
alias: sls — grep equivalent
Search text in files. -CaseSensitive for exact match. -Context 2 for surrounding lines. -List for filenames only.
... | Where-Object {$_ -match "x"}
alias: where, ?
Filter pipeline objects. -like for wildcards, -eq for equality, -gt/-lt for numeric comparison.
... | Sort-Object CPU -Descending
alias: sort
Sort pipeline by any property. Numeric when property is numeric — no parsing needed.
... | Measure-Object -Line -Word
wc equivalent
Count lines, words, characters in pipeline content or file data.
// Process & System
Get-Process [name]
alias: gps, ps
List processes. Returns objects with .CPU, .WorkingSet, .Id, .Name properties for pipeline use.
Stop-Process -Id 1234 -Force
alias: kill
Terminate process by PID or -Name. -Force for unresponsive. -WhatIf to preview.
Get-Service | Restart-Service
alias: gsv
List/control Windows services. Start-Service, Stop-Service, Set-Service also available.
Get-NetTCPConnection -State Listen
netstat equivalent
Show listening TCP ports as objects. Filter by LocalPort, State, OwningProcess.
Test-NetConnection host -Port 443
enhanced ping
Test TCP connectivity. Returns TcpTestSucceeded, PingSucceeded, RTT. Replaces telnet for port checks.
Invoke-WebRequest https://api.site.com
alias: iwr, curl, wget
HTTP client. -Method POST -Body -Headers for REST APIs. Returns object with .StatusCode, .Content.
// cmd.exe vs PowerShell Quick Reference
Taskcmd.exePowerShell
List filesdirGet-ChildItem / ls
Change dircd pathSet-Location / cd
Print filetype file.txtGet-Content / cat
Copycopy src dstCopy-Item / cp
Deletedel file.txtRemove-Item / rm
Search textfindstr "x" fileSelect-String "x" file
List processestasklistGet-Process
Kill processtaskkill /PID 1234 /FStop-Process -Id 1234
Network infoipconfig /allGet-NetIPConfiguration
Env variable%VARNAME%$env:VARNAME
Clear screenclsClear-Host / cls