Guest User

Untitled

a guest
Aug 10th, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. powershell weirdly encodes ampersands when I try to set the value to an xml attribute
  2. function set-connectionstring {
  3. param($path, $name, $value)
  4. $settings = [xml](get-content $path)
  5. $setting = $settings.configuration.connectionStrings.add | where { $_.name -eq $name }
  6. $setting.connectionString = "$value"
  7. $setting.providerName = "System.Data.SqlClient"
  8. $resolvedPath = resolve-path($path)
  9. $settings.save($resolvedPath)
  10. }
  11.  
  12. [System.Reflection.Assembly]::LoadWithPartialName("System.web")
  13. [System.Web.HttpUtility]::HtmlDecode(""")
Advertisement
Add Comment
Please, Sign In to add comment