I want to compare two objects and get only the different values. I have this code:
$a = ("this is blah blah DOG")
$b = ("Dit is blah BLAH dog")
Compare-Object -ReferenceObject $a -DifferenceObject $b
with the above code I get the following output:
InputObject SideIndicator
----------- -------------
Dit is blah BLAH dog =>
this is blah blah DOG <=
However I want only the different values in both the objects i.e. Dit and this
Compare-Objectworks on the whole objects and its properties. It will not do lazy string matching. If you wanted that you need to split the string into arrays firstBeware of potential issues with case sensitivity and use the
-CaseSensitiveas needed.