Stuart Dryden
asked on
Powershell import xml to array (non-cli xml)
Hi, after researching, reading source on github for any modules that bring in xml, checking out the contents of an export-clixml file it seems such a simple request yet such a complicated solution to want to read an XML file and put the contents in an array. I can do it manually by using an online XML to JSON convertor and then using ConvertFrom-Json but i need to automate this as part of my powershell script.
Is anyone aware of a command / function or powershell module that can read a valid XML file of any schema, construct the correct PSObject noteproperty members and populate it with the intended data from that XML file?
Kindest regards !!
Is anyone aware of a command / function or powershell module that can read a valid XML file of any schema, construct the correct PSObject noteproperty members and populate it with the intended data from that XML file?
Kindest regards !!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sometimes I find it difficult to visualize the XML if it didn't come from a file I can look at. In those cases this may help.
Glad to help.
$data | format-custom
Glad to help.
ASKER
VERY cool !!
:)
:)
ASKER
Its amazing that the result is so simple and i did get close - actually i succeeded in one of my many attempts but did not test it correctly drilling down through the elements and nodes as in your example .
Thanks for your help :)