Skip to content

Dependency on variable in parent scope (Build-PSBuildUpdatableHelp) #54

Closed

Description

@IMJLA

Expected Behavior

The following command should successfully complete its call to New-ExternalHelpCab:

Build-PSBuildUpdatableHelp -DocsPath 'C:\Temp\docs' -OutputPath 'C:\Temp\dist\UpdatableHelp'

Current Behavior

Currently an error is thrown if the $ModuleName variable is not correctly defined in the parent scope:

 New-ExternalHelpCab: untitled:Untitled-2:49:29
Line |
  49 |          New-ExternalHelpCab @cabParams > $null
     |                              ~~~~~~~~~~
     | Cannot validate argument on parameter 'LandingPagePath'. Path 'C:\Temp\docs/en-US/.md' is not a file.

Possible Solution

This can be addressed by adding a Module parameter that defaults to the value of the $ModuleName variable

Steps to Reproduce (for bugs)

  1. Launch pwsh
  2. Run this command:
Build-PSBuildUpdatableHelp -DocsPath 'C:\Temp\docs' -OutputPath 'C:\Temp\dist\UpdatableHelp'

Context

This will make it easier to use Build-PSBuildUpdatableHelp in custom psake tasks

Your Environment

  • Module version used: 0.6.1
  • Operating System and PowerShell version:
$PSVersionTable


Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions