Skip to content

Commit e12bff4

Browse files
committed
Updated convert-ps2md.ps1 and export-to-manuals.ps1
1 parent 46a49b5 commit e12bff4

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

scripts/convert-ps2md.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ function GetRemark { param($Example)
5252

5353
try {
5454
if ($filename -eq "") { $filename = Read-Host "Enter path to PowerShell script" }
55-
$ScriptName = (Get-Item "$filename").Name
5655

56+
$ScriptName = (Get-Item "$filename").Name
5757
$full = Get-Help $filename -Full
5858

59-
"*$($ScriptName)*"
60-
"================"
59+
"Script: *$($ScriptName)*"
60+
"========================"
6161

6262
$Description = ($full.description | Out-String).Trim()
6363
if ($Description -ne "") {

scripts/export-to-manuals.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.SYNOPSIS
33
Exports all scripts as manuals
44
.DESCRIPTION
5-
This PowerShell script exports the comment based help of all PowerShell scripts as manuals.
5+
This PowerShell script exports the comment-based help of all PowerShell scripts as manuals.
66
.EXAMPLE
77
PS> ./export-to-manuals.ps1
88
⏳ (1/2) Reading PowerShell scripts from /home/mf/PowerShell/scripts/*.ps1 ...
99
⏳ (2/2) Exporting Markdown manuals to /home/mf/PowerShell/docs ...
10-
✔️ Exported 518 Markdown manuals in 28 sec
10+
✔️ Exported 518 Markdown manuals in 28 sec.
1111
.LINK
1212
https://github.com/fleschutz/PowerShell
1313
.NOTES
@@ -16,21 +16,21 @@
1616

1717
#requires -version 2
1818

19-
param([string]$FilePattern = "$PSScriptRoot/*.ps1", [string]$TargetDir = "$PSScriptRoot/../docs")
19+
param([string]$filePattern = "$PSScriptRoot/*.ps1", [string]$targetDir = "$PSScriptRoot/../docs")
2020

2121
try {
22-
$StopWatch = [system.diagnostics.stopwatch]::startNew()
22+
$stopWatch = [system.diagnostics.stopwatch]::startNew()
2323

24-
"⏳ (1/2) Reading PowerShell scripts from $FilePattern ..."
25-
$Scripts = Get-ChildItem "$FilePattern"
24+
"⏳ (1/2) Reading PowerShell scripts from $filePattern ..."
25+
$scripts = Get-ChildItem "$filePattern"
2626

27-
"⏳ (2/2) Exporting Markdown manuals to $TargetDir ..."
28-
foreach ($Script in $Scripts) {
29-
& "$PSScriptRoot/convert-ps2md.ps1" "$Script" > "$TargetDir/$($Script.BaseName).md"
27+
"⏳ (2/2) Exporting Markdown manuals to $targetDir ..."
28+
foreach ($script in $scripts) {
29+
& "$PSScriptRoot/convert-ps2md.ps1" "$script" > "$targetDir/$($script.BaseName).md"
3030
}
3131

32-
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
33-
"✔️ Exported $($Scripts.Count) Markdown manuals in $Elapsed sec"
32+
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
33+
"✔️ Exported $($scripts.Count) Markdown manuals in $elapsed sec."
3434
exit 0 # success
3535
} catch {
3636
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

0 commit comments

Comments
 (0)