In Powershell,
suppose I have the following xml:
<Users>
<User Name="Foo">
<Friends>
<Friend Name="Bar"/>
</Friends>
</User>
<User Name="Foo2" />
<User Name="Foo3">
<Friends>
<Friend Name="Bar"/>
</Friends>
</User>
</Users>
How can I get all the users that have a “Bar” as a friend?
(In this example it would be Foo,Foo3).
Should I use xpath?
Thanks!
I have a preference for using XPath these days. I’ve run into issues using PowerShell’s xml adapter that are annoying like the name collision on
item: