I want to convert multiple XML files with the same XML attribute format to a JSON file using a PowerShell script. The idea is to create a JSON list with each item being the JSON representation of the XML file. Is it doable? An example of input and output:
Input:
File1.xml:
<File>
<Child1> First xml child 1</Child1>
<Child2>First xml child 2</Child2>
</File>
File2.xml:
<File>
<Child1> Second xml child 1</Child1>
<Child2>Second xml child 2</Child2>
</File>
Output:
[
{
File: [
{Child1 : First xml child 1 },
{ Child2: First xml child 2}
]
},
{
File: [
{Child1 : Second xml child 1 },
{ Child2: Second xml child 2}
]
}
]