@@ -37,6 +37,37 @@ Contributions are welcome in [Psake-repo](https://github.com/psake/psake).
3737 HelpVersion = " $ ( $script :psakeVersion ) "
3838 }
3939 $script :docsOutputFolder = Join-Path - Path $docusaurusOptions.DocsFolder - ChildPath $docusaurusOptions.Sidebar | Join-Path - ChildPath " *.*"
40+
41+ # -----------------------------------------------------------------------------
42+ # PowerShellBuild command reference options
43+ # -----------------------------------------------------------------------------
44+
45+ $script :psbVersion = (Get-Module PowerShellBuild - ListAvailable | Sort-Object Version - Descending | Select-Object - First 1 ).Version
46+ $script :psbOptions = @ {
47+ Module = " PowerShellBuild"
48+ DocsFolder = " ./docs"
49+ SideBar = " psb-commands"
50+ EditUrl = " null"
51+ Exclude = @ ()
52+ MetaDescription = ' Help page for the PowerShellBuild "%1" command'
53+ MetaKeywords = @ (
54+ " PowerShell"
55+ " PowerShellBuild"
56+ " Help"
57+ " Documentation"
58+ )
59+ PrependMarkdown = @"
60+ :::info This page was generated
61+ Contributions are welcome in [PowerShellBuild-repo](https://github.com/psake/PowerShellBuild).
62+ :::
63+ "@
64+ AppendMarkdown = @"
65+ ## VERSION
66+ *This page was generated using comment-based help in [PowerShellBuild $ ( $psbVersion ) ](https://github.com/psake/PowerShellBuild).*
67+ "@
68+ HelpVersion = " $ ( $script :psbVersion ) "
69+ }
70+ $script :psbOutputFolder = Join-Path - Path $psbOptions.DocsFolder - ChildPath $psbOptions.Sidebar | Join-Path - ChildPath " *.*"
4071}
4172
4273FormatTaskName {
@@ -56,7 +87,7 @@ Task 'Init' @{
5687
5788Task ' Build' @ {
5889 Description = ' Full production site build.'
59- DependsOn = @ (' Init' , ' GenerateCommandReference' , ' FrontMatterCMSSync' )
90+ DependsOn = @ (' Init' , ' GenerateCommandReference' , ' GenerateCommandReferencePSB ' , ' FrontMatterCMSSync' )
6091 Action = { exec { bun run build } }
6192}
6293
@@ -119,6 +150,30 @@ Task -Name "GenerateCommandReference-Gen" -Depends 'GenerateCommandReference-Cle
119150}
120151# endregion Command Reference Generation Tasks
121152
153+ # region PSB Command Reference Generation Tasks
154+ $taskSplat = @ {
155+ description = " Use Microsoft.PowerShell.PlatyPS to generate PowerShellBuild command reference docs."
156+ depends = ' GenerateCommandReferencePSB-Gen'
157+ }
158+ Task - Name ' GenerateCommandReferencePSB' @taskSplat
159+
160+ Task - Name ' GenerateCommandReferencePSB-Clean' - Action {
161+ Write-Host " Removing existing PSB MDX files" - ForegroundColor Magenta
162+ if (Test-Path - Path $script :psbOutputFolder ) {
163+ Remove-Item - Path $script :psbOutputFolder
164+ }
165+ }
166+
167+ Task - Name " GenerateCommandReferencePSB-Gen" - Depends ' GenerateCommandReferencePSB-Clean' {
168+ Write-Host " Generating new PSB MDX files using Microsoft.PowerShell.PlatyPS" - ForegroundColor Magenta
169+ New-Item - ItemType Directory - Path (Join-Path $psbOptions.DocsFolder $psbOptions.SideBar ) - Force | Out-Null
170+ . " $PSScriptRoot \scripts\New-PsakeDocusaurusHelp.ps1"
171+ Import-Module Microsoft.PowerShell.PlatyPS - Force
172+ Import-Module PowerShellBuild - Force
173+ New-PsakeDocusaurusHelp @psbOptions
174+ }
175+ # endregion PSB Command Reference Generation Tasks
176+
122177# region Sync Front Matter Data
123178Task - Name ' FrontMatterCMSSync' {
124179 (
0 commit comments