Home/PowerShell/PowerShell – Equal Operators

PowerShell – Equal Operators

Equal Operators:

The equal operators return a value of TRUE if its identical or return a value of FALSE if it is not identical. The entire pattern must match an entire value. By default, all comparison operators are case-insensitive. To make a comparison operator case-sensitive, precede the operator name with a “c”. For example, the case-sensitive version of -eq is -ceq. To make the case-insensitivity explicit, precede the operator with an “i”

Operators  Description
-eq equals
-ne not equals
-gt greater than
-ge greater than or equal
-lt less than
-le less than or equal

 

READ  Windows PowerShell System Requirements

Example:

OUTPUT:

Leave A Comment