Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. $c = "C:testweb.config"
  2. $xml = ( Get-Content $c)
  3. $ConnectionString = $xml.configuration.appSettings.add | Where-Object {$_.Key -eq 'ConnectionString'}
  4. $xml.configuration.RemoveChild($ConnectionString.ParentNode)
  5. $xml.save($c)
  6.  
  7. After removing <appSettings> tag from web.config file. Some special Characters like **&#xA;** are adding to web.config file as below:
  8.  
  9. <?xml version="1.0"?>
  10. <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  11. <configSections>
  12. <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, &#xA; System.Web.Extensions, Version=3.5.0.0, Culture=neutral, &#xA; PublicKeyToken=31bf3856ad364e35">
  13. </configSections>
  14. </configuration>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement