Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Pipeline · PowerShell Automation

Direct 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.

When to use this

Use this when passing objects between PowerShell commands.

First 30 seconds

1. The pipeline streams objects between cmdlets.

2. Filter left (use -Filter on source when possible).

3. ForEach-Object for per-item work.

4. Functions with process {} blocks.

5. Avoid collecting huge arrays unnecessarily.

Operational verification

source → filter → transform → output

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
PowerShell 7.5/current
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformPowerShell 7.5/current · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when passing objects between PowerShell commands.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

Use Get-Help to inspect pipeline-input metadata for downstream parameters, then test representative objects with Get-Member. Count and sample objects before and after a transformation, and capture $LASTEXITCODE immediately after native commands. For mutating pipelines, verify the target state separately after the pipeline completes.

Step 2 Common mistakes Narrow the fault
  • Formatting (Format-Table) in the middle of a pipeline.
Step 3 Where it fails Narrow the fault

A pipeline can be syntactically valid but bind the wrong property, silently convert types, enumerate collections unexpectedly or continue after non-terminating errors. Separate upstream object shape, parameter binding, stream behavior, native-process boundaries and final target state. Do not use a pretty table as verification of the pipeline's data contract.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • The pipeline binds objects by value or property name.
  • Filter as early as possible.
  • Objects stream through the pipeline.
Key checks
  • Get-Service | Where-Object Status -eq Running | Sort-Object Name — pipeline
  • Measure-Command { <pipeline> } — performance
  • Pipeline-aware functions (ValueFromPipeline) — design
ReferenceWhy it matters1 section · depth on demand

Worked example

The PowerShell pipeline passes objects — not text — from one command to the next. Each object keeps its properties and methods, so later commands can filter, sort and select by property name without parsing output. This is the main difference from Unix shells and the reason PowerShell one-liners stay readable.

Worked example: find stopped services that should start automatically, on several servers, and export a report.

Get-CimInstance Win32_Service -ComputerName srv01, srv02 -Filter "StartMode='Auto' AND State<>'Running'" |
  Select-Object PSComputerName, Name, DisplayName, State |
  Sort-Object PSComputerName, Name |
  Export-Csv stopped-auto-services.csv -NoTypeInformation

Filter as early as possible (-Filter on the source command is evaluated remotely and is far faster than Where-Object afterwards), and use Select-Object near the end to shape the output.

ReferenceImportant terms & boundaries1 section · depth on demand

PowerShell mechanics

The PowerShell pipeline passes objects through the success stream and binds them to downstream parameters. Binding can occur by value or by property name, with type conversion and parameter-set selection influencing the result. Native commands are a separate text/process boundary, and some commands buffer input while others stream item-by-item, which changes memory, ordering and latency behavior.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Authoring and lifecycle

Build pipelines so each stage has a clear input/output contract. Filter and project objects before expensive remote or serialization boundaries, delay formatting until the final human-facing step, and avoid relying on implicit property-name binding when a schema can vary. When mixing native tools with PowerShell, quote arguments deliberately and handle encoding plus exit codes explicitly.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

PowerShell 7.5/current 7.5/currentMinimal authored PowerShell pattern for Pipeline

Assumptions: Review target identity, permissions and environment before mutation.

Get-Process | Where-Object CPU -gt 0 | Select-Object Id,ProcessName,CPU
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docPowerShell 7.5/current 7.5/current

Microsoft Learn documentation reviewed for bounded PowerShell reference claims. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pipelines?view=powershell-7.5 · confidence 94%
Embedded reference data

Quick lookup tables

Pipeline · PowerShell operational reference

Topic-specific PowerShell runtime identity, persistence, verification, output and failure-boundary lookup.

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
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Pipeline display order does not necessarily show execution order when concurrency or remote operations are involved. Formatting cmdlets terminate the useful object-data contract for further machine processing. Non-terminating errors can interleave with success output, and native stderr/stdout/exit-code behavior does not map one-to-one to PowerShell ErrorRecords.

Confirmation

Confirm action

Continue?