-cne

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

Syntax
      expression -cne expression

cne is a case-sensitive match and will ignore wildcards.

This operator returns True or False.

Examples

PS C:\> 'alpha' -cne 'alphA'
True
PS C:\> 123 -cne 123
False
PS C:\> $demo = 456
PS C:\> $demo -ne 456
True

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

Related PowerShell Cmdlets:

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


 
Copyright © 1999-2021 SS64.com
Some rights reserved