Skip to content

Instantly share code, notes, and snippets.

@grenade
Created January 16, 2014 17:45
Show Gist options
  • Save grenade/8459746 to your computer and use it in GitHub Desktop.
Save grenade/8459746 to your computer and use it in GitHub Desktop.
$connectionString = "Data Source=localhost;Initial Catalog=SomeDatabase;Integrated Security=True"
$config = "path\to\app.config"
$xml = (Get-Content $config) -as [xml]
$xml.SelectSingleNode('/configuration/connectionStrings/add[@name="ConnectionString.Key"]/@connectionString').set_InnerXML($connectionString)
$xml.Save($config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment