i want to convert a xml file to csv with powershell. how can i map the xml fields to csv? the inputs fields are variable .
i added 2 screenshots , the first is the xml input file , the second the expected csv output
$xml = @"
<?xml version="1.0" encoding="utf-8"?>
<DeviceConfig>
<Device Debiteurnummer="input" facuurnummer="input" factuurdatum="input" />
</DeviceConfig>
"@
$xmlData = [xml]$xml
$xmlData.DeviceConfig.ChildNodes | Export-Csv "c:\pstest\test.csv" -NoTypeInformation -
Delimiter:";" -Encoding:UTF8