Skip to content

Commit 42d74ee

Browse files
authored
Added Module parameter to Build-PSBuildUpdatableHelp (#55)
* Added Module parameter and an [IO.Path]::Combine() The Module parameter removes the dependency on the $ModuleName variable in the parent scope while maintaining the existing behavior of inheriting its value. * The LandingPagePath key in $cabParams now uses the [IO.Path]::Combine([string[]]) method rather than manual string concatenation
1 parent 0d56cac commit 42d74ee

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

PowerShellBuild/Public/Build-PSBuildUpdatableHelp.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ function Build-PSBuildUpdatableHelp {
88
Path to PlatyPS markdown help files.
99
.PARAMETER OutputPath
1010
Path to create updatable help .cab file in.
11+
.PARAMETER Module
12+
Name of the module to create a .cab file for. Defaults to the $ModuleName variable from the parent scope.
1113
.EXAMPLE
1214
PS> Build-PSBuildUpdatableHelp -DocsPath ./docs -OutputPath ./Output/UpdatableHelp
1315
@@ -19,7 +21,9 @@ function Build-PSBuildUpdatableHelp {
1921
[string]$DocsPath,
2022

2123
[parameter(Mandatory)]
22-
[string]$OutputPath
24+
[string]$OutputPath,
25+
26+
[string]$Module = $ModuleName
2327
)
2428

2529
if ($null -ne $IsWindows -and -not $IsWindows) {
@@ -42,7 +46,7 @@ function Build-PSBuildUpdatableHelp {
4246
foreach ($locale in $helpLocales) {
4347
$cabParams = @{
4448
CabFilesFolder = [IO.Path]::Combine($moduleOutDir, $locale)
45-
LandingPagePath = "$DocsPath/$locale/$ModuleName.md"
49+
LandingPagePath = [IO.Path]::Combine($DocsPath, $locale, "$Module.md")
4650
OutputFolder = $OutputPath
4751
Verbose = $VerbosePreference
4852
}

0 commit comments

Comments
 (0)