Update configSource of XML element in web.config using Powershell by passing in Parameters

前端 未结 2 1669
长情又很酷
长情又很酷 2021-01-07 04:26

I am trying to figure out a way to update my web.config for different environments by updating the configSource for the appSettings element in the web.config.

Here

2条回答
  •  无人及你
    2021-01-07 05:11

    Finally figured it out.

    $root = $xml.get_DocumentElement().SelectSingleNode("//client[@configSource]").configSource = "test"
    

    of course, I will replace "//client[@configSource]" with a variable so I can pass in different nodes as parameters to create my base script.

提交回复
热议问题