I have been building my script modules using the non-monolithic script module design following the way Mike F Robbins does it. Each function is in a separate PS1 file that is dot-sourced from the PSM1 file. I really like building my modules this way, but I am having an issue publishing to a local PowerShell Gallery when I have 7 or more functions in the Public folder.
Summary of how I build my script modules:
• Create new script module scaffolding using custom Plaster template.
• Add functions to a folder named Public.
• Update module version and FunctionsToExport section in manifest.
• Use PsDeploy or Publish-Module to deploy to a local PowerShell Gallery.
• The local PowerShell Gallery is just a folder on my data drive G:\JnPowerShellGallery.
If I copy 6 (or less) functions to the Public folder and update module version and FunctionsToExport section in manifest, I can publish the module successfully.
Example: FunctionsToExport = ‘Get-Test1’, 'Get-Test2 ', ‘Get-Test3’, ‘Get-Test4’, ‘Get-Test5’, ‘Get-Test6’
This works fine: VERBOSE: Successfully published module…
If I simply copy a 7th function to the Public folder and update module version and FunctionsToExport section in manifest, the publish will hang.
FunctionsToExport = ‘Get-Test1’, 'Get-Test2 ', ‘Get-Test3’, ‘Get-Test4’, ‘Get-Test5’, ‘Get-Test6’, ‘Get-Test7’
This will hang at ‘VERBOSE: Performing the operation “Publish-Module” on target…’
This is how I am publishing my module to a local PSGallery.
Publish-Module -Path ‘G:_temp\JnTestModule’ -Repository JnPowerShellGallery -NuGetApiKey ‘AnyStringWillDo’ -Verbose -InformationAction Continue
Here is a Dropbox link to my test module.
Mike F Robbins blog post.
https://mikefrobbins.com/2018/09/21/powershell-script-module-design-philosophy/
I am so close to building my first release pipeline for my PowerShell modules, but I am stuck at this point.
Does anyone know what might be causing this issue?