Skip to content

Commit d7a1d5d

Browse files
Refactor Build-PSModuleDocumentation.ps1 to enhance output formatting; adjust spacing in Write-Host messages for improved readability.
1 parent 98f0b8b commit d7a1d5d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/helpers/Build-PSModuleDocumentation.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,27 +96,29 @@
9696

9797
# find the source code file that matches the markdown file
9898
$scriptPath = Get-ChildItem -Path $PublicFunctionsFolder -Recurse -Force | Where-Object { $_.Name -eq ($file.BaseName + '.ps1') }
99-
Write-Host " PS1 path: $scriptPath"
99+
Write-Host " PS1 path: $scriptPath"
100100
$docsFilePath = ($scriptPath.FullName).Replace($PublicFunctionsFolder.FullName, $DocsOutputFolder.FullName).Replace('.ps1', '.md')
101-
Write-Host " MD path: $docsFilePath"
101+
Write-Host " MD path: $docsFilePath"
102102
$docsFolderPath = Split-Path -Path $docsFilePath -Parent
103103
$null = New-Item -Path $docsFolderPath -ItemType Directory -Force
104104
Move-Item -Path $file.FullName -Destination $docsFilePath -Force
105105
}
106-
# Get the MD files that are in the public functions folder and move them to the same place in the docs folder
106+
107+
Write-Host '::group::Build docs - Move markdown files from source files to docs'
107108
Get-ChildItem -Path $PublicFunctionsFolder -Recurse -Force -Include '*.md' | ForEach-Object {
108109
$file = $_
109110
$relPath = [System.IO.Path]::GetRelativePath($PublicFunctionsFolder.FullName, $file.FullName)
110111
Write-Host " - $relPath"
111112
Write-Host " Path: $file"
112113

113114
$docsFilePath = ($file.FullName).Replace($PublicFunctionsFolder.FullName, $DocsOutputFolder.FullName)
114-
Write-Host " MD path: $docsFilePath"
115+
Write-Host " MD path: $docsFilePath"
115116
$docsFolderPath = Split-Path -Path $docsFilePath -Parent
116117
$null = New-Item -Path $docsFolderPath -ItemType Directory -Force
117118
Move-Item -Path $file.FullName -Destination $docsFilePath -Force
118119
}
119120

121+
Write-Host '────────────────────────────────────────────────────────────────────────────────'
120122
Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object {
121123
$fileName = $_.Name
122124
Write-Host "::group:: - [$fileName]"

0 commit comments

Comments
 (0)