I have two variables in sorted order.
$a contains
Gi1/1
Gi1/2
$b contains
Gi1/1
Gi1/2
Gi1/3
I tried to compare two variables whether it is equal or not equal as below:
if($a -eq $b) {
write-host "equal"
} else {
write-host "not equal"
}
but it didn't seem to work. The output should be "not equal", but it outputs as "equal". How can I fix this?
$aand$bvariables being declared? You haven't provided enough information.Stringobjects, for example?)Select-String@Bill_Stewart