I'm fairly new to PowerShell, but have a strong C# background.
The task I'm trying to accomplish is to download some XML, and then save some of the elements from the XML file in a .csv file. I don't need all the elements from the XML, just a few items.
The XML looks something like this:
<result>
<case>
<InputData>
<Id>1</Id>
<Firstname>John</Firstname>
<Lastname>Smith</Lastname>
<....lots more properties and subnodes I don't need>
</InputData>
</case>
</result>
I've managed to download the XML using something like this:
$downloaded = ([Xml](New-Object Net.WebClient).DownloadString("http://url.to.server/file.xml"))
Now I need to extract just a few of the properties from the XML, and export it to CSV file.
I understand that I can reach the data with $downloaded.result.case[0].InputData.Firstname, but need some advice on how to extract a few of the properties and save as CSV.