I'd like to use PowerShell as part of our automated build process to update an App.config file while deploying into our test environment. How can I do this?
The code can be much more shorter (based on Robin's app.config):
$appConfig = [xml](cat D:\temp\App.config)
$appConfig.configuration.connectionStrings.add | foreach {
$_.connectionString = "your connection string"
}
$appConfig.Save("D:\temp\App.config")