•Arnošt Havelka
Filter with Where-Object
Use Where-Object to find items matching conditions.
Start Interactive LessonThe Where-Object cmdlet filters items based on conditions. Find exactly what you need from large datasets.
Filtering with Conditions
Try the command
Filter items with conditions!
Build the command
Get-ChildItem[arguments]|Where-Object[arguments]
Get-ChildItem|Where-Object
Terminal
PS C:\Users\Student>Get-ChildItem | Where-Object {$_.Length -gt 1000}
large-report.txt
Targeted Search
Terminal
file1.txt
file2.txt
file3.txt
PS C:\Users\Student\Documents\WhereDemo>Get-ChildItem
Knowledge Check
1 / 1What does -gt mean?
References
These documentation links provide authoritative details for the commands used in this article.
Up Next
Powerful Piping in PowerShell
Chain commands together with pipes for advanced operations.