I have this following XML that I need to read the attributes dynamically however I am stuck in finding the correct way to do it in PS:
<DataGroups>
<Category1 Identifier="Project789">
<Category2 Identifier="Project234">
<SimpleCategory56 Identifier="Project56">
......
</DataGroups>
I have tried the following till now which works however how do I do this dynamically??
$xml = [xml](get-content $Path)
$test = $xml.DataGroups.Category1.Identifier
I have also tried doing something this:
$xml = [xml](get-content $Path)
Select-Xml -Xml $xml -XPath "//Category1/@Identifier"
but then I am getting somwthing cryptic like the following:
Node Path Pattern
---- ---- -------
Identifier InputStream //Category1/@Identifier