3.10.1.11

Issue 380 - Additional format of XML for ADMX and Reg value
This commit is contained in:
Mikael Karlsson
2025-11-25 20:14:00 +11:00
parent 7b87325776
commit 469408d29f
+3 -3
View File
@@ -2765,11 +2765,11 @@ function Update-XmlFormatting {
) )
process { process {
# 1. Fix empty xml elements → <tag/> instead of <tag /> $Xml = $Xml -replace "`r`n", "`n"
$Xml = $Xml -replace '<([^\s/>]+)([^>]*)\s/>' , '<$1$2/>' $Xml = $Xml -replace '<([^\s/>]+)([^>]*)\s/>' , '<$1$2/>'
# 2. Remove empty lines (lines containing only whitespace or nothing) $Xml = ($Xml -split "`n") |
$Xml = ($Xml -split "`r?`n") |
Where-Object { $_.Trim().Length -gt 0 } | Where-Object { $_.Trim().Length -gt 0 } |
ForEach-Object { $_ } | ForEach-Object { $_ } |
Out-String Out-String