Skip to content

Commit f8df325

Browse files
committed
feat(markdown): ✨ Add Overwrite parameter to Build-PSBuildMarkdown
* Introduced a new `.PARAMETER Overwrite` to allow overwriting existing markdown files. * Updated the `New-MarkdownHelp` command to utilize the `Overwrite` parameter.
1 parent 6cf2f54 commit f8df325

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

PowerShellBuild/Public/Build-PSBuildMarkdown.ps1

+8-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function Build-PSBuildMarkdown {
1212
The path where PlatyPS markdown docs will be saved.
1313
.PARAMETER Locale
1414
The locale to save the markdown docs.
15+
.PARAMETER Overwrite
16+
Overwrite existing markdown files and use comment based help as the source of truth.
1517
.EXAMPLE
1618
PS> Build-PSBuildMarkdown -ModulePath ./output/MyModule/0.1.0 -ModuleName MyModule -DocsPath ./docs -Locale en-US
1719
@@ -55,12 +57,12 @@ function Build-PSBuildMarkdown {
5557

5658
# ErrorAction set to SilentlyContinue so this command will not overwrite an existing MD file.
5759
$newMDParams = @{
58-
Module = $ModuleName
59-
Locale = $Locale
60-
OutputFolder = [IO.Path]::Combine($DocsPath, $Locale)
61-
ErrorAction = 'SilentlyContinue'
62-
Verbose = $VerbosePreference
63-
Force = $Overwrite
60+
Module = $ModuleName
61+
Locale = $Locale
62+
OutputFolder = [IO.Path]::Combine($DocsPath, $Locale)
63+
ErrorAction = 'SilentlyContinue'
64+
Verbose = $VerbosePreference
65+
Force = $Overwrite
6466
}
6567
New-MarkdownHelp @newMDParams > $null
6668
} finally {

0 commit comments

Comments
 (0)