Update convert-ps2md.ps1

This commit is contained in:
Markus Fleschutz 2021-08-28 12:58:48 +02:00
parent e178405018
commit 1f89c6d625

View File

@ -65,17 +65,26 @@ function GetRemark {
try { try {
$full = Get-Help $script -Full $full = Get-Help $script -Full
"# $($full.Name)"
"$($full.Synopsis)"
$Description = ($full.description | Out-String).Trim()
if ($Description -ne "") {
""
"## Description"
"$Description"
}
$Syntax = (($full.syntax | Out-String) -replace "`r`n", "`r`n`r`n").Trim()
if ($Syntax -ne "") {
""
"## Syntax"
"``````powershell"
"$Syntax"
"``````"
}
@" @"
# $($full.Name)
$($full.Synopsis)
## Description
$(($full.description | Out-String).Trim())
## Syntax
``````powershell
$((($full.syntax | Out-String) -replace "`r`n", "`r`n`r`n").Trim())
``````
## Parameters ## Parameters
"@ + $(foreach ($parameter in $full.parameters.parameter) { "@ + $(foreach ($parameter in $full.parameters.parameter) {
@ -105,16 +114,23 @@ $(GetCode $example)
`````` ``````
$(GetRemark $example) $(GetRemark $example)
## Notes
$(($full.alertSet.alert | Out-String).Trim())
## Related Links
$(($full.relatedlinks | Out-String).Trim())
"@ "@
}) + @" }) + @"
"@ "@
$Notes = ($full.alertSet.alert | Out-String).Trim()
if ($Notes -ne "") {
""
"## Notes"
"$Notes"
}
$Links = ($full.relatedlinks | Out-String).Trim()
if ($Links -ne "") {
""
"## Related Links"
"$Links"
}
} finally { } finally {
} }