mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Updated the Markdown manuals
This commit is contained in:
@ -9,7 +9,7 @@ Parameters
|
||||
PS> ./check-xml-file.ps1 [[-path] <String>] [<CommonParameters>]
|
||||
|
||||
-path <String>
|
||||
Specifies the path to the XML file to check
|
||||
Specifies the path to the XML file
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
@ -26,7 +26,7 @@ Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./check-xml-file.ps1 myfile.xml
|
||||
✔️ Valid XML in 'myfile.xml'
|
||||
✔️ Valid XML in 📄myfile.xml
|
||||
|
||||
```
|
||||
|
||||
@ -43,14 +43,14 @@ Script Content
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Verifies the given XML file
|
||||
Verifies an XML file
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks the given XML file for validity.
|
||||
.PARAMETER path
|
||||
Specifies the path to the XML file to check
|
||||
Specifies the path to the XML file
|
||||
.EXAMPLE
|
||||
PS> ./check-xml-file.ps1 myfile.xml
|
||||
✔️ Valid XML in 'myfile.xml'
|
||||
✔️ Valid XML in 📄myfile.xml
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -74,16 +74,14 @@ try {
|
||||
while ($Reader.Read()) { }
|
||||
$Reader.Close()
|
||||
|
||||
if ($script:ErrorCount -gt 0) {
|
||||
throw "Invalid XML in '$path'"
|
||||
}
|
||||
if ($script:ErrorCount -gt 0) { throw "Invalid XML" }
|
||||
|
||||
"✔️ Valid XML in '$path'"
|
||||
"✔️ Valid XML in 📄$path"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
"⚠️ $($Error[0]) in 📄$path"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 01/03/2024 12:10:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 01/25/2024 13:28:33)*
|
||||
|
Reference in New Issue
Block a user