filePath = "$env:SystemDrive\inetpub\wwwroot\web.config" # Create The Document $XmlWriter = New-Object System.XMl.XmlTextWriter($filePath,$Null) ...

$filePath = "$env:SystemDrive\inetpub\wwwroot\web.config"           # Create The Document          $XmlWriter = New-Object System.XMl.XmlTextWriter($filePath,$Null)           # Set The Formatting          $xmlWriter.Formatting = "Indented"          $xmlWriter.Indentation = "4"          # Write the XML Decleration          $xmlWriter.WriteStartDocument()            # Write Root Element          $xmlWriter.WriteStartElement("configuration")           # Write the Document          $xmlWriter.WriteStartElement("location")          $xmlWriter.WriteAttributeString($null, "inheritInChildApplications", $null, "false")          $xmlWriter.WriteElementString("system.webServer", $null)          $xmlWriter.WriteStartElement("system.web")          $xmlWriter.WriteStartElement("machineKey")          $xmlWriter.WriteAttributeString($null, "validationKey", $null, "AutoGenerate,IsolateApps")          $xmlWriter.WriteEndElement()           $xmlWriter.WriteStartElement("compilation")          $xmlWriter.WriteAttributeString($null, "defaultLanguage", $null, "c#")          $xmlWriter.WriteAttributeString($null, "debug", $null, "false")          $xmlWriter.WriteEndElement()           $xmlWriter.WriteEndElement() #end of system.web          $xmlWriter.WriteEndElement() #end of location          $xmlWriter.WriteEndElement()  #end of configuration          $xmlWriter.WriteEndDocument()           # Finish The Document          $xmlWriter.Finalize          $xmlWriter.Flush          $xmlWriter.Close()
English
English (United States)
Español (España)
Spanish (Spain)
Français (France)
French (France)
italiano
Italian
한국어
Korean
Português
Portuguese
Русский
Russian