I am working on a script to loop through a series of .config files (XML) and replace an attribute value. I have this code working with an array containing a list of files to edit. I now would like to add a second part to the array to store the XML path of the attribute I want to edit.
File XML Path Attribute Name
a.config Configuration.Servers.Server password
b.config Configuration.Servers.Server password
c.config WSProcConfig SystemPassword
My current code has the XML Path and Attribute Name hard coded as shown below:
$node = $xml.Configuration.Servers.Server
What I really would like to do is have the XML Path and Attribute Name retrieved from the array.
The question is this:
1. How do I format the array? My current array looks like this:
$ConfigFilesArray = @(
2. How do I read each part of the array?
I looked at a hash table, however, that seems to require knowing the file to get the rest of the data. I am just not sure how all of that needs put together in the Powershell world.
Your help is appreciated.