Skip to content

Instantly share code, notes, and snippets.

@arcware
Last active June 9, 2021 17:25
Show Gist options
  • Save arcware/d9e04ae9d1b798460262 to your computer and use it in GitHub Desktop.
Save arcware/d9e04ae9d1b798460262 to your computer and use it in GitHub Desktop.
Using PowerShell to Modify AppSettings in Web.config
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