I'd like to move hashtables from one array to another.
Assuming that I have an array of hashtables:
PS> $a = @( @{s='a';e='b'}, @{s='b';e='c'}, @{s='b';e='d'} )
Name Value
---- -----
s a
e b
s b
e c
s b
e d
I can copy a selected set to another array:
PS> $b = $a | ? {$_.s -Eq 'b'}
Name Value
---- -----
s b
e c
s b
e d
Then remove b's items from a:
PS> $a = $a | ? {$b -NotContains $_}
Name Value
---- -----
s a
e b
Is there a more-succinct way of doing this?