I’m using an API that’s returning results as an XMLdocument variable. After reading online, it seemed like it would be simple to parse, but it doesn’t look like others.
If I expand XmlElement, I’ll see an array of more XmlElement and XmlWhitespace arrays.
Looking under the InnerXML and OuterXML attributes, I can see the data tree but I have no clue how to parse it. I also don’t know what attributes will be returned. I found an attribute of some XmlElements named “InnerText” that seems to have some (maybe all) the information that I’m looking for, but I’d have to manually parse it myself.
Is there a way to simply export it to a CSV or convert it to a more readable data type like an array? Trying to find my way through the array of arrays of XML objects isn’t fun.
Not sure if this means anything to anyone, but I’m making the API call using Invoke-RestMethod