I have two Powershell objects, one with yesterdays failed servers, another with todays failed servers.
I want to compare the two objects and only return the servers that are present in todays list but not in yesterdays list, ignoring any that appear in both lists and ignoring any that appear in yesterdays list but not todays list.
Only way I've found to do this is by using filtering using Where-Object
as below:
Compare-Object -ReferenceObject $YesterdayData -DifferenceObject $TodaysData -Property Server -PassThru | Where-Object {$_.SideIndicator -like '=>'}
I feel there must be another way of doing this without the Where-Object
filter?