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).
Get-Help about_operator command for more information and examples.