I have an array of nested dictionary-style arrays, like $Events here, with a column of property names and a column of values:
PS > $Events[0].EventProperties
Name #text
------- -------
EventName ItBroke
Category Bad
When 2020
For reference, the data like this that I use is usually from xml that looks like this, so maybe I could process this better?:
<Events>
<EventProperties Name="EventName">ItBroke</EventProperties>
<EventProperties Name="Category">Bad</EventProperties>
<EventProperties Name="When">2020</EventProperties>
</Events>
<Events ... />
I want to convert the nested EventProperties member arrays to objects instead, with properties of Name =Name and Value =#text like below:
PS > $EventData[0]
EventName : ItBroke
Category : Bad
When : 2020
I'll answer with the way I do this currently, but it's just slow and scales poorly so I'm looking for help structuring this better. It feels like something simple that I don't know the correct terms for to find on my own.