-ne

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

Syntax
      expression -ne expression

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

This operator returns True or False.

Examples

PS C:\> 'alpha' -ne 'beta'
True
PS C:\> 123 -ne 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:

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


© Copyright SS64.com 1999-2013
Some rights reserved