mirror of
https://github.com/Micke-K/IntuneManagement.git
synced 2026-09-28 10:55:38 +02:00
3.10.1.11
Issue 380 - Additional format of XML for ADMX and Reg value
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user