We publish almost 180 modules (AWS.Tools.*) to PowerShell Gallery in large batches. These modules have dependencies on each other.
I wrote a script that looks at RequiredModules, resolves the dependency graph and does Publish-Module in the right order.
Even if I only try publishing a module when all its dependencies are already published, I still receives failures because Publish-Module checks for presence on the PSGallery of the dependencies and PSGallery doesn't reliably report that the modules I have just published are actually there.
Because of the large number of modules we are publishing, waiting minutes between each Publish-Module invocation is not an option.
Expected behavior
Either PSGallery could guarantee consistency in a specific amount of time for this particular use case (for example wait 5 seconds after Publish-Module succeeds before calling Publish-Module for a dependent module); or there could be a Publish-Module switch to disable dependency checking.
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.2.0
PSEdition Core
GitCommitId 6.2.0
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
There will always be a lag between publishing and being available due to validation. Perhaps a -SkipDependencyCheck type of switch for publishing might be ok, but need to think through the ramifications.
Steps to reproduce
We publish almost 180 modules (
AWS.Tools.*
) to PowerShell Gallery in large batches. These modules have dependencies on each other. I wrote a script that looks atRequiredModules
, resolves the dependency graph and doesPublish-Module
in the right order. Even if I only try publishing a module when all its dependencies are already published, I still receives failures becausePublish-Module
checks for presence on the PSGallery of the dependencies and PSGallery doesn't reliably report that the modules I have just published are actually there. Because of the large number of modules we are publishing, waiting minutes between each Publish-Module invocation is not an option.Expected behavior
Either PSGallery could guarantee consistency in a specific amount of time for this particular use case (for example wait 5 seconds after
Publish-Module
succeeds before callingPublish-Module
for a dependent module); or there could be aPublish-Module
switch to disable dependency checking.Environment data