O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Operators

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:

Image Arithmetic—When comparing numbers or integers, for example:

5 -gt 4

Image 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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required