-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
False

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

Related PowerShell Cmdlets

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