@@ -40,21 +40,28 @@ if ($Push) {
4040# # Requires PlatyPS, Pester, PSScriptAnalyzer and Alt3.Docusaurus.PowerShell installed.
4141
4242if ($UpdateHelp ) {
43- if (-Not ($DocusaurusPath )) {
44- throw ' DocusaurusPath parameter is required when updating help'
45- } elseif (-Not (Resolve-Path - Path $DocusaurusPath )) {
46- throw ' DocusaurusPath does not resolve to a valid path'
43+ $DocsFolderPath = Join-Path - Path $DocusaurusPath - ChildPath ' docs' - AdditionalChildPath $Script :ModuleName
44+ if (-Not (Test-Path - Path $DocsFolderPath )) {
45+ New-Item - Path $DocsFolderPath - ItemType Directory | Out-Null
4746 }
47+ $MarkdownHeader = @'
48+ :::powershell[Generated Cmdlet Help]
49+ This page has been generated from the {0} PowerShell module source. To make changes please edit the appropriate PowerShell source file.
50+ :::
51+ '@ -f $Script :ModuleName
4852 $ExcludeFiles = Get-ChildItem - Path " $ ( $PSScriptRoot ) \Private" - Filter ' *.ps1' - Recurse | ForEach-Object { [System.IO.Path ]::GetFileNameWithoutExtension($_.FullName ) }
4953 $NewDocusaurusHelpParams = @ {
50- Module = (' .\{0}.psm1 ' -f $ModuleName )
51- DocsFolder = Join-Path - Path $DocusaurusPath - ChildPath ' docs ' - AdditionalChildPath $ModuleName
54+ Module = (' .\{0}.psd1 ' -f $Script : ModuleName )
55+ DocsFolder = $DocsFolderPath
5256 Exclude = $ExcludeFiles
5357 Sidebar = ' commandlets'
5458 # MetaDescription = 'Generated cmdlet help for the %1 commandlet.'
55- NoPlaceHolderExamples = $true
5659 GroupByVerb = $true
5760 UseDescriptionFromHelp = $true
61+ NoPlaceHolderExamples = $true
62+ UseCustomShortTitles = $false
63+ PrependMarkdown = $MarkdownHeader
64+ RemoveParameters = @ (' -ProgressAction' , ' -FakeParam' )
5865 }
5966 New-DocusaurusHelp @NewDocusaurusHelpParams | Out-Null
6067 $CommandletDocsFolder = Join-Path - Path $DocusaurusPath - ChildPath ' docs' - AdditionalChildPath @ ($ModuleName , ' commandlets' )
0 commit comments