Back to Blog
Arnošt Havelka

Filter with Where-Object

Use Where-Object to find items matching conditions.

Start Interactive Lesson
Filter with Where-Object

Filter with Where-Object

The Where-Object cmdlet filters items based on conditions. Find exactly what you need from large datasets.

Filtering with Conditions

Usage:Get-ChildItem | Where-Object {$_.Length -gt [size]}
-gt
Greater than
-lt
Less than
-like
Pattern matching

Targeted Search

Command Prompt
file1.txt (500 bytes) file2.txt (2000 bytes) file3.txt (100 bytes)
C:\Users\User>Get-ChildItem

Knowledge Check

1 / 1

What does -gt mean?

References

These Microsoft Learn and Windows 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.