3.10.1.10

Issue 380 - ADMX Import / Reg Values fails because of XML format.
This commit is contained in:
Mikael Karlsson
2025-11-24 21:56:42 +11:00
parent 7657fac645
commit 7b87325776
2 changed files with 68 additions and 9 deletions
+21
View File
@@ -2757,6 +2757,27 @@ function Format-XML
$StringWriter.ToString()
}
function Update-XmlFormatting {
[CmdletBinding()]
param(
[Parameter(Mandatory, ValueFromPipeline)]
[string]$Xml
)
process {
# 1. Fix empty xml elements → <tag/> instead of <tag />
$Xml = $Xml -replace '<([^\s/>]+)([^>]*)\s/>' , '<$1$2/>'
# 2. Remove empty lines (lines containing only whitespace or nothing)
$Xml = ($Xml -split "`r?`n") |
Where-Object { $_.Trim().Length -gt 0 } |
ForEach-Object { $_ } |
Out-String
return $Xml.Trim()
}
}
function Show-LogView
{
if($script:LogViewObject -and -not $script:LogViewObject.ViewPanel)