mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Update Markdown manuals
This commit is contained in:
@ -5,9 +5,9 @@
|
||||
This PowerShell script exports the comment based help of all PowerShell scripts as manuals.
|
||||
.EXAMPLE
|
||||
PS> ./export-to-manuals.ps1
|
||||
⏳ (1/2) Reading scripts from: /home/mf/PowerShell/Scripts/*.ps1...
|
||||
⏳ (2/2) Exporting manuals to: /home/mf/PowerShell/Scripts/../Docs...
|
||||
✔️ exported 518 PowerShell scripts in 28 sec
|
||||
⏳ (1/2) Reading PowerShell scripts from /home/mf/PowerShell/Scripts/*.ps1 ...
|
||||
⏳ (2/2) Exporting Markdown manuals to /home/mf/PowerShell/Scripts/../Docs ...
|
||||
✔️ exported 518 Markdown manuals in 28 sec
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -21,16 +21,16 @@ param([string]$FilePattern = "$PSScriptRoot/*.ps1", [string]$TargetDir = "$PSScr
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
"⏳ (1/2) Reading scripts from: $FilePattern..."
|
||||
"⏳ (1/2) Reading PowerShell scripts from $FilePattern ..."
|
||||
$Scripts = Get-ChildItem "$FilePattern"
|
||||
|
||||
"⏳ (2/2) Exporting manuals to: $TargetDir..."
|
||||
"⏳ (2/2) Exporting Markdown manuals to $TargetDir ..."
|
||||
foreach ($Script in $Scripts) {
|
||||
& "$PSScriptRoot/convert-ps2md.ps1" "$Script" > "$TargetDir/$($Script.BaseName).md"
|
||||
}
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ exported $($Scripts.Count) PowerShell scripts in $Elapsed sec"
|
||||
"✔️ exported $($Scripts.Count) Markdown manuals in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Reference in New Issue
Block a user