I have an XML file that was written from a powershell "Export-Clixml" call and it appears quite strange to me.
Here's a very simple sample:
PS C:\> Get-Date | Export-Clixml sample.xml
PS C:\> cat .\sample.xml
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<DT>2018-03-21T08:05:39.5085956-04:00</DT>
<MS>
<Obj N="DisplayHint" RefId="1">
<TN RefId="0">
<T>Microsoft.PowerShell.Commands.DisplayHintType</T>
<T>System.Enum</T>
<T>System.ValueType</T>
<T>System.Object</T>
</TN>
<ToString>DateTime</ToString>
<I32>2</I32>
</Obj>
</MS>
</Obj>
</Objs>
How are you supposed to parse these "Objs" and "MS" and "TN" and the rest of it? I need something that can reliably read this in python. Does anyone have a way to do this?
ConvertTo-Xml has an output like this
<?xml version="1.0"?>
<Objects>
<Object Type="System.Collections.Hashtable">
<Property Name="Key" Type="System.String">someKey</Property>
<Property Name="Value" Type="System.String">value</Property>
<Property Name="Key" Type="System.String">otherKey</Property>
<Property Name="Value" Type="System.String">otherValue</Property>
</Object>
</Objects>
So there's no way to tell which "key" goes with which "value" other than the position.