psake / PowerShellBuild

Common build tasks for psake and Invoke-Build that build and test PowerShell modules
MIT License
133 stars 24 forks source link

Powershellget error when pushing module to private repo #56

Closed FLeven closed 1 year ago

FLeven commented 2 years ago

I need to publish the module to a private nexus repo and get an error:

Expected Behavior

save-module publish-module

Current Behavior

Publish-Module

The specified RequiredModules entry 'BuildHelpers' in the module
manifest 'C:\Users\jenkins\AppData\Local\Temp\1443179751\PowerShellBuild\PowerShellBuild.psd1' is invalid. Try again
after updating this entry with valid values.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:10817 char:27

Workaround

Remove the required modules from the psd1 file

RequiredModules = @( @{ModuleName = 'BuildHelpers'; ModuleVersion = '2.0.16'} @{ModuleName = 'Pester'; ModuleVersion = '5.3.1'} @{ModuleName = 'platyPS'; ModuleVersion = '0.14.2'} @{ModuleName = 'psake'; ModuleVersion = '4.9.0'} )

Steps to Reproduce (for bugs)

save-module publish-module

Your Environment

Jenkins-agent running PowerShell 5.1 in Windows Docker Server Core container

pauby commented 2 years ago

I don't think the solution is a valid one. The issue is publishing to your Nexus and I feel you should concentrate on resolving that issue rather than removing the required module from the manifest which would affect everybody.

FLeven commented 2 years ago

Of cause, I only offered a dirty workaround for the problem. I an not sure if it is exclusively related to nexus, as powershellget is throwing the error.

devblackops commented 1 year ago

@FLeven This is likely because BuildHelpers is not published to your Nexus repository. Publish-Module will verify that any modules listed in RequiredModules are available in the repository you're deploying to.