Sample code:
$hosts = Get-View -ViewType hostsystem -Property name,network
$clusters = Get-View -ViewType clustercomputeresource -Property name,network,host
$hosts | Add-Member -MemberType AliasProperty -Name TEST -value MoRef
$clusters | Add-Member -MemberType AliasProperty -Name TEST -Value Host
I would like to speed my scripts when parsing data and want to use Compare-Object
.
However, the code
Compare-Object $hosts $clusters[0] -Property TEST -IncludeEqual -ExcludeDifferent -PassThru
is giving no output.
The code
Compare-Object $hosts.test $clusters[0].test -IncludeEqual -ExcludeDifferent -Pass -PassThru
is giving me exact matches, but not passing through the objects.
Unfortunately I cannot determine why.