Say I have structures like:
[xml]$i = "
<root>
<item>
<id>1</id>
<data>Content_Of_1</data>
</item>
<item>
<id>2</id>
<data>Content_Of_2</data>
<item>
<id>5</id>
<data>Content_Of_5</data>
</item>
</item>
</root>
"
$foo = @(1,2,3)
And I want to select $i.root.item.data where $i.root.item.id is in $foo.
To select the nodes matching IDs in the array I can do:
($i.root.item | ? {$foo -contains $_.id})
But for some reason if I try to get at $_.data, I get nothing:
($i.root.item | ? {$foo -contains $_.id}).data
Why?