-eq

Eq is a comparison operator that will test if one numeric or string expression is equal to another,

Syntax
      expression -eq expression

Eq is a case-insensitive match and will ignore wildcards.

This operator returns True or False.

Examples

PS C:\> 'alpha' -eq 'beta'
False
PS C:\> 123 -eq 123
True
PS C:\> $demo = 456
PS C:\> $demo -eq 456
True

“All animals are equal But some animals are more equal than others” ~ George Orwell, Animal Farm

Related:

-ceq - Case sensitive -eq
-ne - Test for non equality
-contains - test for the existence of one item in a collection, array or hashtable.
Syntax - Comparison Operators


© Copyright SS64.com 1999-2014
Some rights reserved