December 2013
Intermediate to advanced
1872 pages
153h 31m
English
A task commonly performed both from the console and also in scripts is to compare two strings against each other. The most common operators are as follows:
Arithmetic—When comparing numbers or integers, for example:
5 -gt 4
Comparison—When comparing strings, for example:
"user" -eq "user"
In both of these cases, a Boolean value is returned (True or False).
Note
Execute the Get-Help about_operator command for more information and examples.