Automation · PowerShell Automation
Pipeline
Cheat sheet · https://pcornel.dk/topic.php?topic=5232
Answer
The PowerShell pipeline passes objects from one command to the next, binding them to parameters by value or property name, such as Get-ADUser -Filter * | Set-ADUser -Department IT.
Remember
- The pipeline binds objects by value or property name.
- Filter as early as possible.
- Objects stream through the pipeline.
First checks
Get-Service | Where-Object Status -eq Running | Sort-Object Name— pipelineMeasure-Command { <pipeline> }— performance- Pipeline-aware functions (ValueFromPipeline) — design
Verify in this order
source → filter → transform → output
Where it usually breaks
Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.
Pipeline · PowerShell operational reference
| Boundary | Pipeline reference |
|---|---|
| Runtime identity | PowerShell edition/version + command/module source |
| Persistent intent | Script/module/config prerequisites under source control |
| Verification | Read-only discovery → execution evidence → independent target read-back |
| Output contract | Structured objects/streams before formatting |
| Failure boundary | Separate engine/binding from transport/API/native and target-state failures |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5232