Last active
June 9, 2021 17:25
-
-
Save arcware/d9e04ae9d1b798460262 to your computer and use it in GitHub Desktop.
Using PowerShell to Modify AppSettings in Web.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param($config, $key, $value) | |
$doc = New-Object System.Xml.XmlDocument | |
$doc.Load($config) | |
$node = $doc.SelectSingleNode('configuration/appSettings/add[@key="' + $key + '"]') | |
$node.Attributes['value'].Value = $value | |
$doc.Save($config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment