Quick question
Is there a better (i.e. more efficient / more concise) way to do this?
compare-object $a $b | ?{$_.SideIndicator -eq '<='}
Detail
Compare-Object gives paramaxers -excludeDifferent and -includeEqual so you can change what results you get.
- using both gives you an inner join
- using only
-includeEqual , you get a full outer join - using only
-excludeDifferent is pointless; since identical elements are excluded by default, so now it will exclude everything.
There are no options for -includeLeft , -excludeLeft or the like.
Currently, to perform a left outer join, where the right side is null (i.e., elements in the reference object that are not in the difference object), I need to filter the results manually, according to the code above.
Am I missing something / is there a better way?
http://ss64.com/ps/compare-object.html
source share