Where-Object is PowerShell’s generic pipeline filter. It examines objects one at a time and passes along only those that satisfy a comparison; its alias is where. section 12.2 section 12.4
Place filtering as far left in a pipeline as practical. Removing unwanted objects early reduces later work and may reduce unnecessary network data, although individual cmdlets sometimes offer more limited filtering of their own. section 12.2 section 12.5
Keep processes using more than 100 MB
Get-Process | Where-Object -FilterScript {$_.WorkingSet -gt 100MB} The -FilterScript parameter is positional, so this can also be written as Get-Process | Where-Object {$_.WorkingSet -gt 100MB}. For each process, $_ represents the current object, .WorkingSet selects its property, and -gt performs the comparison. section 12.4
Get-Process | Where-Object -FilterScript {$_.WorkingSet -gt 100MB}
Use this runnable listing to see the full filter-script form for selecting processes by WorkingSet. section 12.4
The simplified syntax supports a single comparison: Get-Process | where WorkingSet -gt 100MB. Use the script-block form when combining tests, such as WorkingSet -gt 100MB -and CPU -gt 100. section 12.4
Verify property names with Get-Member rather than trusting displayed column headings. A formatted heading such as PM(MB) may represent a property with a different name. section 12.4
Build a process query iteratively
Get-Process | Where-Object { $_.Name -notlike 'pwsh*' } | Sort-Object VM -Descending | Select -First 10 | Measure-Object -Property VM -Sum Run a command, inspect its results, recall it with the up arrow, and add the next pipeline step. This makes filtering, sorting, selection, and measurement easy to test incrementally. section 12.5
$_ is valid where PowerShell expects the current pipeline object. In nested pipelines, each Where-Object receives its own input: strings can be filtered first, followed later by process objects and their properties. section 12.6.2
Where-Object also works with files, modules, dates, event records, and text-matching conditions, including filters combined with -and and -match. section 12.8 section 21.4

