Powershell Comparision Operators
Comparision operators are used to compare the values of two operands. Default comparision done on case insensitive.
| Operator | Name | Description |
|---|---|---|
| -eq | Equality | Check for equality of two operands |
| -ne | Negated Equality | Check for not equal |
| -ge | Greater than equal | Check for greter than equal |
| -gt | Greater than | check for greater than |
| -in | in | Check for an operand in list of values |
| -notin | negated in | Check for an operand not in list of values |
| -lt | Less than | Check for less than |
| -le | Less than Equal | Check for less than equal |
| -like | Like | Matching with like of text |
| -notlike | Negated Like | not match with like |
| -match | Match | Using regular expression match |
| -notmatch | Negated Match | sing regular expression not match |
| -isno | Negated Type | Checke for not type |
| -is | Type | Check for type of an variable |
| -notcontains | Contains | Check for contains for exists or not |
| -contains | Negated Contains | Check for not contains an item |
to use case sensitive search, prefix each operator with c
For example
Powershell Logical Operators
| Logical Operator | Description |
|---|---|
| -and | Logical ANd |
| -or | Logical OR |
| -not | Logical Not |
| -xor | Logical XOR |