A comparison tests the relationship between two values and returns a Boolean result: True or False. In PowerShell, comparison operators express equality, inequality, ordering, and text-pattern relationships. section 12.3
Use these PowerShell operators to test values:
- -eq and -ne test equality and inequality; -gt, -lt, -ge, and -le test numeric or date ordering. section 12.3
- String comparisons are case-insensitive by default; the c-prefixed operators, such as -ceq and -cgt, request case-sensitive comparisons. section 12.3
- Combine tests with -and or -or, and reverse a Boolean value with -not. section 12.3
Filter processes by memory
Get-Process | Where-Object {$_.WorkingSet -gt 100MB} examines each process. The $_ placeholder represents the current object, WorkingSet selects its property, and only objects producing True continue through the pipeline. Verify property names with Get-Member rather than relying on displayed column headings. section 12.4
Get-Process | where WorkingSet -gt 100MB
Use the shorter Where-Object form for a single comparison: Get-Process | where WorkingSet -gt 100MB. section 12.4







