I have three nodes with the same name but with different attributes. I would like to only select the one where the bar attribute exists.
<Test foo="Hello" />
<Test bar="World" />
<Test zed="Goodbye" />
You could use XPath for this:
Select-Xml -Path path\to\file.xml -XPath '//Test[@bar]'
//Test will resolve any <Test> nodes anywhere in the tree, [@bar] filters them by whether they have a bar attribute or not