集合
求B的补集:
$A = 1, 2, 3, 4
$B = 2,4
$A | where {$B -notcontains $_}
求A,B的交集:
$A = 1, 2, 3, 4
$B = 2,4
$A | where {$B -contains $_}
求A,B的全集:
$A = 1, 2, 3, 4
$B = 2, 4, 9
$AjiaoB = $A | where {$B -contains $_} #A与B的交集
$AA = $a | where {$AjiaoB -notcontains $_} #$AjiaoB相对于$A的补集
$BB = $b | where {$AjiaoB -notcontains $_} #$AjiaoB相对于$B的补集
($AjiaoB + $AA + $BB) | Sort-Object -Descending