ekkohdev/powershell-module-template

Updates to Publish-Module require the source folder to be the same as the module name

Closed this issue · 1 comments

Expected Behavior

When performing the Invoke-Build -Task Publish, assuming all requirements are met, the module should be published to PSGallery.

Actual Behavior

When performing the Invoke-Build -Task Publish all tasks complete, except the publish itself, returning an error:

No valid module was found at the specified location

Steps to Reproduce the Problem

  1. Create an otherwise valid PowerShell Module that passes all tests and compiles
  2. Perform Invoke-Build -Task Publish
  3. The error is returned

One of the current requirements for Publish-Module is that the Folder/Directory specified in the -Path parameter have the same name as the module itself. In the Module Build script the folder name is build.

Specifications

  • Version: Plaster 1.0.x
  • Platform: PowerShell Core
  • Subsystem: Invoke-Build

Solution

Adjust the Build script to create a sub-folder under build using the module name, derived in the same way as in other parts of the script.

I will submit a PR for the same.

Thanks for the contribution! Apologies it has taken me so long to get back to this and get it merged.

Closed via #4