Is there an easy way to create a list from an XML file? I have a process that executes a loop keeping count, but is not appeading to the list file.
I first get a count of the number of rows and set a counter to the number of rows + 1.
Then I figure the number of rows - 1.
If the number of rows is < = 0 it should end.
If the number of rows is > 0 it should append to the list.
I am using the folowing to append to the list
Once it appends to the list it should return to subtract again and loop accordingly.
the XML looks good. It's named countyXML and looks like this:
I am getting an invocation error when it tries to append to the list.
Any help would be appreciated.
See this thread
The Custom DSC can be found here :
Let me know if you need the source code to modify for your need.
I think the problem is with the XPATH,
try to use the number function even if you decalred the variable as int
Lists are 1 index based i.e. First item would be added at index 1 of the list, not from 0.
So pls check if your counter variable is starting from value 1. Rest of the thing seems to be fine.