Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # $webConfig = 'C:\Temp\Web.Config'
- # [xml]$doc = Get-Content $webConfig
- # har gjort om det lite för att du ska kunna se exempel
- # hoppar över att läsa och skriva till fil
- [xml]$doc = @"
- <?xml version="1.0" encoding="utf-8"?>
- <configuration>
- <connectionStrings configSource="org-value" />
- </configuration>
- "@
- $root = $doc.get_DocumentElement();
- $root.connectionStrings.configSource.Replace('org-value','new-value')
- $root.connectionStrings.configSource
- $doc.Save()
- $doc.configuration.connectionStrings
- # $doc.Save($webConfig)
- # <connectionStrings configSource="Config\ConnectionStringsTemp.config" />
- # <connectionStrings configSource="Config\ConnectionStrings.config" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement