Pcornel
Automation · PowerShell Automation

Pipeline

Cheat sheet · https://pcornel.dk/topic.php?topic=5232

Back to the Topic

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 — pipeline
  • Measure-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

BoundaryPipeline reference
Runtime identityPowerShell edition/version + command/module source
Persistent intentScript/module/config prerequisites under source control
VerificationRead-only discovery → execution evidence → independent target read-back
Output contractStructured objects/streams before formatting
Failure boundarySeparate 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

Confirmation

Confirm action

Continue?