Where-Object
Where-Object is a PowerShell cmdlet that filters pipeline objects according to specified properties, conditions, or criteria.
Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
Where-Object is a PowerShell cmdlet that filters objects in the pipeline according to specified criteria.
- How it is used
- Filters retrieved pipeline objects when an upstream cmdlet cannot express all required criteria.
- How deep it goes
- Explains per-object evaluation, comparison syntax, $_, nested pipelines, property names, and iterative construction without descending into implementation internals.
- Examples
- Demonstrates process, file, module, date, event-log, regex, and nested-content filters.
- What you can do after
- Apply it via PowerShell pipelines to retain objects matching property comparisons, wildcard tests, compound conditions, or regular expressions.
Practical Automation with PowerShell: Effective scripting from the console to the cloud
Where-Object is a PowerShell cmdlet that filters objects in a pipeline according to a specified condition.
- How it is used
- Filters pipeline objects for operational selection, while steering source-level filtering when available for efficiency.
- How deep it goes
- Explains pipeline-by-pipeline filtering costs and demonstrates property conditions in disk and VHD automation.
- Examples
- Demonstrates filtering SQL results, locating a VHD by Path, selecting raw disks, and limiting a file watcher to XML files.
- What you can do after
- Apply it to select pipeline objects by properties while choosing earlier cmdlet or SQL filters for high-volume retrieval.
Related concepts
- monitoringuses · Monitoring is the ongoing observation and measurement of a system’s behavior, state, or operational signals to assess its condition and detect changes or problems.
- Select-Objectcontrasts with · Select-Object is a PowerShell cmdlet that selects properties or creates customized objects from input objects.
- filteringkind of · Filtering is the operation of selecting or excluding items from data or a collection according to specified criteria.
- cmdletkind of · A cmdlet is a specialized PowerShell command, typically implemented as a .NET class, that performs a focused operation.
- aliasalternative to · An alias is an alternative name by which an entity, command, parameter, or resource can be referred to.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

