I don't know what's going on with Compare-Object in my Script.
My Compare-Object outputs a perfect output
InputObject SideIndicator
----------- -------------
@{ComputerName=USSFMW-V03021; CollectionName=} ==
@{ComputerName=USSFMW-V03013; CollectionName=} ==
Exporting this into an CSV works perfectly
Compare-Object $alreadyCombs $Computers -IncludeEqual #| Export-CSV $newComptuersCSV
But this :
$test = Compare-Object $alreadyCombs $Computers -IncludeEqual
results in an empty output:
{@{InputObject=; SideIndicator===}, @{InputObject=; SideIndicator===},
I'm not that long into powershell, and I wonder if I did not understand the logic behind Pipeing and putting the values into a variable.
At the moment, I'm exporting it into CSV, importing it again, deleting CSV... It works good but I can't show this code anybody, that's a pity ....^^