Cmdlets, Objects & the Pipeline
20 minThe three ideas that make PowerShell click: Verb-Noun cmdlets, objects (not text), and the pipeline.
- ▸Understand why PowerShell passes objects, not text
- ▸Read any cmdlet's name from its Verb-Noun shape
- ▸Discover and inspect commands with Get-Command, Get-Help and Get-Member
- ▸Chain cmdlets together with the pipeline
Why PowerShell is different
If you come from Bash, the single most important thing to unlearn is this: PowerShell pipes objects, not text.
In Bash, every command spits out a stream of text and the next command has to re-parse it (hence awk, cut, sed). In PowerShell, a command hands the next one a real object with named properties and methods. No fragile string-scraping.
# Bash thinking: grep the text, cut the column you hope is right
# PowerShell thinking: ask the object for the property by name
Get-Service | Where-Object Status -eq 'Running'
Cmdlets are Verb-Noun
Every built-in command (a cmdlet) is named Verb-Noun, always singular:
| Cmdlet | Reads as |
|---|---|
Get-Service | get the service(s) |
Restart-Service | restart a service |
Stop-Process | stop a process |
Get-EventLog | get the event log |
Verbs are from an approved list (Get, Set, New, Remove, Start, Stop, Restart…), so once you know the noun you can usually guess the command. This consistency is why PowerShell scales from one server to ten thousand.
The three commands that teach you everything
You never need to memorise cmdlets — you need to know how to discover them:
Get-Command *service* # find every command with 'service' in the name
Get-Help Restart-Service -Examples # see real usage examples
Get-Service | Get-Member # list the properties & methods of the objects
Get-Member is the secret weapon: pipe anything into it and it tells you exactly what properties you can select and filter on. When you're stuck, Get-Member is the answer.
The pipeline
The | passes the objects from one cmdlet to the next. Each stage refines the last:
Get-Service |
Where-Object Status -eq 'Running' |
Select-Object Name, DisplayName |
Sort-Object Name
Read it top to bottom: get the services → keep the running ones → take two properties → sort them. That readable, composable flow is PowerShell at its best.
Quick check
You've just opened PowerShell on a freshly built Windows Server 2022 box. Before you change anything, a good engineer explores. Let's use the discovery cmdlets to find your way around — the same first moves you'd make on any unfamiliar machine.
Type each command in the script pane and press ▶ Run (or F5).
You need to manage Windows services but can't remember the exact cmdlet names. Discover them: list every command whose name contains Service.