mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-30 04:31:39 +02:00
Update manuals
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
convert-ps2md.ps1 [<script>]
|
||||
convert-ps2md.ps1 [<filename>]
|
||||
.DESCRIPTION
|
||||
Converts the comment-based help of a PowerShell script to Markdown.
|
||||
.EXAMPLE
|
||||
@ -11,7 +11,7 @@
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
param([string]$script = "")
|
||||
param([string]$filename = "")
|
||||
|
||||
function EncodePartOfHtml { param([string]$Value)
|
||||
($Value -replace '<', '<') -replace '>', '>'
|
||||
@ -51,12 +51,12 @@ function GetRemark { param($Example)
|
||||
}
|
||||
|
||||
try {
|
||||
if ($script -eq "") { $script = read-host "Enter path to PowerShell script" }
|
||||
$ScriptName = (get-item "$script").Name
|
||||
if ($filename -eq "") { $filename = read-host "Enter path to PowerShell script" }
|
||||
$ScriptName = (get-item "$filename").Name
|
||||
|
||||
$full = Get-Help $script -Full
|
||||
$full = Get-Help $filename -Full
|
||||
|
||||
"# PowerShell Script $scriptName"
|
||||
"# PowerShell Script $ScriptName"
|
||||
|
||||
""
|
||||
"## Synopsis & Description"
|
||||
@ -128,7 +128,7 @@ try {
|
||||
}
|
||||
|
||||
""
|
||||
"*Generated by convert-ps2md.ps1*"
|
||||
"*Generated from comment-based help of $ScriptName by convert-ps2md.ps1*"
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
|
Reference in New Issue
Block a user