Updated check-xml-file.ps1

This commit is contained in:
Markus Fleschutz 2025-04-30 10:48:13 +02:00
parent 7d247e379f
commit 7bc0509211

View File

@ -7,7 +7,7 @@
Specifies the path to the XML file Specifies the path to the XML file
.EXAMPLE .EXAMPLE
PS> ./check-xml-file.ps1 myfile.xml PS> ./check-xml-file.ps1 myfile.xml
Valid XML in 📄myfile.xml myfile.xml is valid XML
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -34,7 +34,7 @@ try {
if ($script:ErrorCount -gt 0) { throw "Invalid XML" } if ($script:ErrorCount -gt 0) { throw "Invalid XML" }
"Valid XML in 📄$path" "$path is valid XML"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ $($Error[0]) in 📄$path" "⚠️ $($Error[0]) in 📄$path"