Public/Set-ISDataFolder.ps1
function Set-ISDataFolder { param( [string] $ConfigPath, [string] $FolderName ) $Xml = Load-XmlDocument -Path $ConfigPath $XmlNamespace = New-Object System.Xml.XmlNamespaceManager($Xml.NameTable) $XmlNamespace.AddNamespace("ns", "http://intellisearch.com/ICD/ICDConfiguration.xsd") #DevSkim: ignore DS137138 # dataPath $Node = $Xml.SelectSingleNode("//ns:ICDConfiguration", $XmlNamespace) $Attribute = $Xml.CreateNode("attribute", "dataPath", "") #DevSkim: ignore DS137138 $Attribute.Value = "..\..\..\Data\$($FolderName)\" [void] $Node.SetAttributeNode($Attribute) # cacheDataPath $Node = $Xml.SelectSingleNode("//ns:ICDConfiguration/ns:Cache", $XmlNamespace) [void] $Node.SetAttribute("cacheDataPath", "..\..\..\Data\$($FolderName)\Cache\") Save-XmlDocument -XmlDocument $Xml -Path $ConfigPath } |