Comparison Operators

say it: “kum-PAIR-ih-sun OP-uh-ray-terz” /kəmˈpærɪsən ˈɑpəreɪtərz/

Operators like `-eq`, `-gt`, `-like` and `-match`.

What is Comparison Operators?

PowerShell uses word-like comparison operators: -eq, -ne, -gt, -lt, -like (wildcards), -match (regular expressions). They ignore case by default.

5 -gt 3              # True
'Pancakes' -like 'Pan*' # True
'abc' -eq 'ABC'       # True (case-insensitive)

Level: Apprentice · More PowerShell terms at this level

Updated

In other subjects