I am trying to compare two objects in PS.
$object1 = "1.1.1.1,2.2.2.2,3.3.3.3" $object2 = "3.3.3.3,4.4.4.4"
How do I compare these two objects and include similarities into a new variable?
I've tried -
$compare = Compare-Object -IncludeEqual $object1 $object2 | Select -ExpandProperty InputObject
But no luck with the whole Compare-Object cmdlet.