I have an array object $a which returns an output like below.

And by doing $a[0].Name I can access each "Name" entry, $a[0].Available I can access its corresponding Available space.
I have another array say $b which contains some names, say $b returns me two names "sandeep_aggr1" and "aggr4". This is just an array (no properties like Name, Avaiable), not an object, so It can't use Compare-Object.
I want to remove other entries in the original object $a, except for those with "Name" equal to "sandeep_aggr1" and "aggr4".
This is what I am doing.
foreach($bb in $b)
{
foreach($aa in $a)
{
if($aa.Name -ne $bb)
{
$aa.Remove($aa.Name)
}
}
}
echo $a
But, I don't see the elements deleted, am I missing something here ? Any help appreciated