PowerShell works with objects, not text. Commands pass structured data between each other, making scripting more reliable and powerful.
Command Structure
Verb-Noun Format
All cmdlets follow a consistent Verb-Noun pattern:
Get-Process - retrieve processes
Set-Location - change directory
Stop-Service - stop a service
New-Item - create a file or folder
Common Verbs
Get - retrieve data
Set - change configuration
New - create something
Remove - delete something
Start/Stop - control services/processes
Import/Export - work with data
Getting Help
PowerShell has excellent built-in documentation:
# Get help for any commandGet-Help Get-Process# Get detailed help with examplesGet-Help Get-Process -FullGet-Help Get-Process -Examples# Update help files (run once)Update-Help# Find commandsGet-Command *process*Get-Command -Verb GetGet-Command -Noun Service
The Pipeline
The pipeline (|) passes entire objects between commands:
# Get processes, filter by CPU usage, select specific propertiesGet-Process | Where-Object {$_.CPU -gt 10} | Select-Object Name, CPU, Memory# Get services that are runningGet-Service | Where-Object {$_.Status -eq "Running"}# Get files larger than 1MBGet-ChildItem | Where-Object {$_.Length -gt 1MB}
-eq # equal-ne # not equal-gt # greater than-lt # less than-ge # greater than or equal-le # less than or equal-like # wildcard match-match # regex match
# Display as tableGet-Process | Format-Table# Display as listGet-Process | Format-List# Export to CSVGet-Process | Export-Csv processes.csv# Export to JSONGet-Process | ConvertTo-Json | Out-File processes.json# Save to text fileGet-Process | Out-File processes.txt
Basic Scripting
If Statements
$value = 10if ($value -gt 5) { Write-Host "Greater than 5"} elseif ($value -eq 5) { Write-Host "Equal to 5"} else { Write-Host "Less than 5"}