Automating config file changes : Part 2 – modifying already existing config keys
This post contains the Powershell script to modify already existing config key values in a config file. A sample web.config file is given below <?xml version=”1.0″?> <configuration> <system.web> <customErrors mode=”On” defaultRedirect=”Error.htm”> <error statusCode=”404″ redirect=”http://myAppDevWeb/404.aspx”/> </customErrors> </system.web> <appSettings> <add key=”DBServer” value=”myAppDevDB”/> </appSettings> </configuration> We want to modify the 404 redirect page address and DBServer by passing the required values to the Powershell script.
Here is the original:
Automating config file changes : Part 2 – modifying already existing config keys


