-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 PowerShell Cmdlets

-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 © 1999-2024 SS64.com
Some rights reserved