I'm sure this is simple but I am just trying to wrap my head around it. I have an XML file that looks like this:
<software>
<program>Bob</program>
<program>Reader</program>
<program>Hello</program>
<program>Java</program>
</software>
I am then pulling it into the script like this
[xml]$xml = Get-Content configuration.xml
foreach( $entry in $xml.software)
{
$arrayofsoftware = $entry.program
}
First thing to note is I don't know how many program entries will be in the XML. What I am looking to do is put all of that software into some sort of array. I then need to seperate it later on into seperate variables (as I need to pass each one as a switch to a command line).
Can anyone throw me in the right direction?