Skip to content

Commit 8fcbac4

Browse files
committed
chore(docs): ✨ Update changelog and documentation for Overwrite parameter
* Clarified the behavior of the `$PSBPreference.Docs.Overwrite` parameter. * Updated the default value from `$true` to `$false` in configuration files. * Enhanced error handling in `Build-PSBuildMarkdown` function.
1 parent f8df325 commit 8fcbac4

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111

1212
- [**#71**](https://github.com/psake/PowerShellBuild/pull/71) Compiled modules
1313
are now explicitly created as UTF-8 files.
14-
- [**#67**](https://github.com/psake/PowerShellBuild/pull/67) Overwrite existing
15-
markdown files and use the comment based help as the source of truth. This can
16-
be disabled if `$PSBPreference.Docs.Overwrite` is set to `$false`.
14+
- [**#67**](https://github.com/psake/PowerShellBuild/pull/67) You can now
15+
overwrite existing markdown files using `$PSBPreference.Docs.Overwrite` and
16+
setting it to `$true`.
1717

1818
## [0.6.2] 2024-10-06
1919

PowerShellBuild/Public/Build-PSBuildMarkdown.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ function Build-PSBuildMarkdown {
6464
Verbose = $VerbosePreference
6565
Force = $Overwrite
6666
}
67+
if ($Overwrite) {
68+
$newMDParams.Add('Force', $true)
69+
$newMDParams.Remove('ErrorAction')
70+
}
6771
New-MarkdownHelp @newMDParams > $null
72+
} catch {
73+
Write-Error "Failed to generate markdown help. : $_"
6874
} finally {
6975
Remove-Module $moduleName
7076
}

PowerShellBuild/build.properties.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ $moduleVersion = (Import-PowerShellDataFile -Path $env:BHPSModuleManifest).Modul
112112
# Directory PlatyPS markdown documentation will be saved to
113113
RootDir = [IO.Path]::Combine($env:BHProjectPath, 'docs')
114114

115-
# Overwrite existing markdown files and use comment based help as the source of truth
116-
Overwrite = $true
115+
# Whether to overwrite existing markdown files and use comment based help as the source of truth
116+
Overwrite = $false
117117
}
118118
Publish = @{
119119
# PowerShell repository name to publish modules to

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ match your environment.
119119
| $PSBPreference.Help.DefaultLocale | `(Get-UICulture).Name` | Default locale used for help generation |
120120
| $PSBPreference.Help.ConvertReadMeToAboutHelp | `$false` | Convert project readme into the module about file |
121121
| $PSBPreference.Docs.RootDir | `$projectRoot/docs` | Directory PlatyPS markdown documentation will be saved to |
122-
| $PSBPreference.Docs.Overwrite | `$true` | Overwrite the markdown files in the docs folder using the comment based help as the source of truth. |
122+
| $PSBPreference.Docs.Overwrite | `$false` | Overwrite the markdown files in the docs folder using the comment based help as the source of truth. |
123123
| $PSBPreference.Publish.PSRepository | `PSGallery` | PowerShell repository name to publish |
124124
| $PSBPreference.Publish.PSRepositoryApiKey | `$env:PSGALLERY_API_KEY` | API key to authenticate to PowerShell repository with |
125125
| $PSBPreference.Publish.PSRepositoryCredential | `$null` | Credential to authenticate to PowerShell repository with. Overrides `$psRepositoryApiKey` if defined |

0 commit comments

Comments
 (0)