I have navigated my first XML Powershell experience recently with no problem. It features a no namespace xml file and I have mastered xpath to get me anywhere I wish.
Today I ran get-gporeport to produce an xml file with every gpo. I thought I could do my selectnodes and select-xmls with ease. Sadly nothing happened. Google told me about namespaces.
It said, If you dont define namespaces, you cannot read a thing, you cannot dance the xml element search and retrieve.
What’s worse, google has next to nothing about bulletproof “just run this boilerplate code and then you can do selectnodes etc without a problem”.
So either I run through the text of my huge gpo xml file and pull out all this xmlns garbage or define some namespace object that will allow me to xpath with ease.
Has anyone got any decent reference or best practice, particularly with reference to the xml produced by get-gporeport?
I tried the code at http://outputredirection.blogspot.com.au/2010/01/using-powershell-to-search-for-group.html and it didnt work.