With PowerShell, I want to add several sub-elements into an XML tree.
I know to ADD ONE element, I know to add one or several attributes, but I don\'t understand how to
I prefer creating xml by hand, instead of using API to construct it node by node, as imho by hand it will be much more readable and more maintable.
Here is an example:
$pathToConfig = $env:windir + "\Microsoft.NET\Framework64\v4.0.30319\Config\web.config"
$xml = [xml] (type $pathToConfig)
[xml]$appSettingsXml = @"
"@
$xml.configuration.AppendChild($xml.ImportNode($appSettingsXml.appSettings, $true))
$xml.Save($pathToConfig)