Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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