Powershell - Esempi di operatori di confronto

I seguenti script dimostrano gli operatori di confronto.

> $a = 10
 
> $b = 20
 
> $a -eq $b
 False 
 
> $a -ne $b
 True
 
> $b -gt $a
 True
 
> $b -ge $a
 True
 
> $b -lt $a
 False
 
> $b -le $a
 False
 
> $a = "mahesh"
 
> $b = "suresh"
 
> $a -like '*ahe*'
 True
 
> $a -notLike '*ahe*'
 True
 
> $b -match '[h$]'
 True
 
> $b -notMatch '[h$]'
 False
 
> $a = 'abc'
 
> $b = 'abc'
 
> $b -contains $a
 True
 
> $b -notContains $a
 False