PowerShell object pipeline¶
The PowerShell object pipeline is the core mechanism for passing data between cmdlets, allowing the output of one command to be used directly as input for another.^[600-developer-learn-powershell01.md]
Functionality¶
This pipeline is designed to pass .NET objects rather than plain text.^[600-developer-learn-powershell01.md] This object-oriented nature allows subsequent commands to access specific properties of the data directly, rather than relying on text parsing.^[600-developer-learn-powershell01.md]
The pipeline is initiated using the pipe operator (|).^[600-developer-learn-powershell01.md] This operator takes the result set from the left-hand command (e.g., Get-Process) and streams it to the right-hand command for processing, sorting, or filtering.^[600-developer-learn-powershell01.md]
Common Operations¶
The pipeline enables several common data manipulation tasks:
- Property Selection: Users can select specific properties from an object to simplify the output or focus on relevant data^[600-developer-learn-powershell01.md]. For example,
Select-Objectcan retrieve all properties or a specific subset^[600-developer-learn-powershell01.md]. - Sorting and Formatting: Data can be sorted by specific properties (e.g.,
Sort-Object -Property PM)^[600-developer-learn-powershell01.md] and formatted into lists (Format-List) or tables (Format-Table)^[600-developer-learn-powershell01.md].
Related Concepts¶
- [[PowerShell]]
- [[Command-line interface]]
Sources¶
- 600-developer-learn-powershell01.md