I just want to use the list of servers returned from the compare-object output and I get 2 columns. InputObject and SideIndicator. InputObject has the servers I want, and SideIndicator has the '<='. I've tried to just select InputObject from the variable using dot notation but not having any luck.
How do I return just the InputObject values with nothing else?
current output
$GetAllVMs = Get-VM
$AllVMNames = $GetAllVMs.Name
$TaggedVMs = $GetAllVMs | Get-NsxSecurityTagAssignment
$TaggedVMsNames = $TaggedVMs.VirtualMachine.Name
$testing = Compare-Object -ReferenceObject $AllVMNames -DifferenceObject $TaggedVMsNames | Where-Object {$_.SideIndicator -eq "<="} | Select-Object $_.InputObject | Sort-Object InputObject | Format-Table
$testing
InputObject SideIndicator
----------- -------------
server1 <=
server2 <=
server3 <=