Comparison Operators Flashcards
1
Q
-eq
A
equals
ie:
$a = 5
$a -eq 4
False
2
Q
-ne
A
not equal
ie:
$a = 5
$a -ne 4
True
3
Q
-gt
A
greater than
ie:
$a = 5
$a -gt 4
True
4
Q
-ge
A
greater than or equal to
ie:
$a = 5
$a -ge 5
True
5
Q
-lt
A
less than
ie:
$a = 5
$a -lt 5
False
6
Q
-le
A
less than or equal to
ie:
$a = 5
$a -le 5
True
7
Q
-like
A
wildcard comparison
ie:
$a = “This is Text”
$a -like “Text”
False
8
Q
-notlike
A
wildcard comparison
ie:
$a = “This is Text”
$a -like “Text”
False
9
Q
-match
A
regular expression comparison
ie:
$a = “Text is Text”
$a -match “Text”
True
10
Q
-notmatch
A
regular expression comparison
ie:
$a = “This is Text”
$a -notmatch “Text$”
False