Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Dan1el42/31df7a8920176eedb2ed44772abe1ffe to your computer and use it in GitHub Desktop.
Save Dan1el42/31df7a8920176eedb2ed44772abe1ffe to your computer and use it in GitHub Desktop.
$path = "C:\Testing\File.xml"
[Xml]$servicefactoryconfig = Get-Content -Path $path -Raw
$old = $servicefactoryconfig.SelectSingleNode("/factory/map/add[@key='Audit']")
$parent = $old.ParentNode
[void] $parent.RemoveChild($old)
$newNode = [Xml] @'
<add key="Audit" assembly="OpenContent.Platform.Core.dll" class="OpenContent.Core.Audit.Services.AuditASMXProxy">
<parameter name="baseUrl" class="string" value="http://hostname/Website" />
<parameter name="servicePath" class="string" value="Audit/AuditASMX.asmx" />
<parameter name="timeout" class="int" value="120" />
<parameter name="policy" class="string" value="AuditServicePolicy"/>
</add>
'@
[void] $parent.AppendChild($servicefactoryconfig.ImportNode($newNode.add, $true))
$servicefactoryconfig.save($path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment