ckelsoe
asked on
Powershell variable howto question
Hi,
I have this code snippet that works as expected
What I really want to do is pass "Configuration.Servers.Ser ver" as a parameter. The various methods I have tried are failing.
So ultimately I want $node = $xml.$XMLPath where $XMLPath = "Configuration.Servers.Serv er"
I have this code snippet that works as expected
$xml = [xml](Get-Content $path)
$node = $xml.Configuration.Servers.Server
What I really want to do is pass "Configuration.Servers.Ser
So ultimately I want $node = $xml.$XMLPath where $XMLPath = "Configuration.Servers.Serv
Didn't I show you how to do it in your previous question, https://www.experts-exchange.com/questions/28682878/HOWTO-Multidimensional-Arrays.html ?
ASKER
Technically it is a different question - how to combine two variables to get the same result. I did try your method and did not have success with it. The code I have is working fine with the exception of not wanting to hard code the path to the attributes.
I am finding there are multiple ways to perform the same task. I understand that your method is at least one of two methods to change the value of an attribute. As such I do appreciate your help.
I am finding there are multiple ways to perform the same task. I understand that your method is at least one of two methods to change the value of an attribute. As such I do appreciate your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Now that did exactly what I wanted!! Thank You.
I was working through your preferred method. Passing "//configuration/servers/s erver" from the array. Did not get that fully working before I saw this answer. I will play with that method again shortly.
I do appreciate your help very much.
I was working through your preferred method. Passing "//configuration/servers/s
I do appreciate your help very much.