Comparison operators are used for comparing two mathematical expressions which results in true, false or unknown.
PowerShell has a wide variety of comparison operators which are as follows:
- Equal to and not equal to: -eq and -ne
- Like and not like: -like and -notlike
- Greater than and greater than or equal to: -gt and -ge
- Less than and less than or equal to: -lt and -le
- Contains and not contains: -contains and -notcontains
- In and not in: -in and -notin