|
30 | 30 | ) |
31 | 31 |
|
32 | 32 | Write-Host "::group::Documenting module [$ModuleName]" |
33 | | - Write-Host "Source path: [$ModuleSourceFolderPath]" |
| 33 | + [pscustomobject]@{ |
| 34 | + ModuleName = $ModuleName |
| 35 | + ModuleSourceFolderPath = $ModuleSourceFolderPath |
| 36 | + ModulesOutputFolderPath = $ModulesOutputFolderPath |
| 37 | + DocsOutputFolderPath = $DocsOutputFolderPath |
| 38 | + } | Format-List | Out-String |
| 39 | + |
34 | 40 | if (-not (Test-Path -Path $ModuleSourceFolderPath)) { |
35 | 41 | Write-Error "Source folder not found at [$ModuleSourceFolderPath]" |
36 | 42 | exit 1 |
37 | 43 | } |
38 | 44 | $moduleSourceFolder = Get-Item -Path $ModuleSourceFolderPath |
39 | | - Write-Host "Module source folder: [$moduleSourceFolder]" |
40 | | - |
41 | 45 | $moduleOutputFolder = New-Item -Path $ModulesOutputFolderPath -Name $ModuleName -ItemType Directory -Force |
42 | | - Write-Host "Module output folder: [$moduleOutputFolder]" |
43 | | - |
44 | 46 | $docsOutputFolder = New-Item -Path $DocsOutputFolderPath -ItemType Directory -Force |
45 | | - Write-Host "Docs output folder: [$docsOutputFolder]" |
46 | 47 |
|
47 | | - Write-Host '::group::Build docs - Generate markdown help' |
| 48 | + Write-Host '::group::Build docs - Generate markdown help - Raw' |
48 | 49 | Import-PSModule -Path $ModuleOutputFolder |
49 | 50 | Write-Host ($ModuleName | Get-Module) |
50 | 51 | $null = New-MarkdownHelp -Module $ModuleName -OutputFolder $DocsOutputFolder -Force -Verbose |
|
97 | 98 | $docsFilePath = ($scriptPath.FullName).Replace($PublicFunctionsFolder.FullName, $DocsOutputFolder.FullName).Replace('.ps1', '.md') |
98 | 99 | Write-Host "Doc file path: $docsFilePath" |
99 | 100 | $docsFolderPath = Split-Path -Path $docsFilePath -Parent |
100 | | - New-Item -Path $docsFolderPath -ItemType Directory -Force |
| 101 | + $null = New-Item -Path $docsFolderPath -ItemType Directory -Force |
101 | 102 | Move-Item -Path $file.FullName -Destination $docsFilePath -Force |
102 | 103 | } |
103 | 104 | # Get the MD files that are in the public functions folder and move them to the same place in the docs folder |
|
107 | 108 | $docsFilePath = ($file.FullName).Replace($PublicFunctionsFolder.FullName, $DocsOutputFolder.FullName) |
108 | 109 | Write-Host "Doc file path: $docsFilePath" |
109 | 110 | $docsFolderPath = Split-Path -Path $docsFilePath -Parent |
110 | | - New-Item -Path $docsFolderPath -ItemType Directory -Force |
| 111 | + $null = New-Item -Path $docsFolderPath -ItemType Directory -Force |
111 | 112 | Move-Item -Path $file.FullName -Destination $docsFilePath -Force |
112 | 113 | } |
113 | 114 |
|
114 | 115 | Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object { |
115 | 116 | $fileName = $_.Name |
116 | | - $hash = (Get-FileHash -Path $_.FullName -Algorithm SHA256).Hash |
117 | | - Write-Host "::group:: - [$fileName] - [$hash]" |
| 117 | + Write-Host "::group:: - [$fileName]" |
118 | 118 | Show-FileContent -Path $_ |
119 | 119 | } |
120 | 120 | } |
0 commit comments