I’m doing a comparison with compare-object just for the property Name. When the SideIndicator is “==” can I have access to both objects? I want to have access to the other properties that are not “Name”.
Compare-Object $env1 $env2 -IncludeEqual -Property "Name" | ForEach-Object {
$_.LeftObject.Size
$_.RightObject.Size
}
Thank you in advance.
I don’t see a way to get access to both objects. If you remove the Name comparing then you can get acess to the object itself via the InputObject property. That said, there’s no left or right object since it is the same object (equal).