PowerShell / PowerShellGallery

228 stars 65 forks source link

Maximum linked module version? #113

Closed vpopescu closed 3 years ago

vpopescu commented 4 years ago

I am not sure if this is an enhancement request, or I'm just not finding the right reference.

When I publish my Module that deppends on verson 1.x of an existing module, I may want to automatically pick up any changes to the existing module (e.g. 1.1, 1.2) BUT I may not want to automatically pick up a v2.x, since 2.x may have breaking changes.

Can I

a) limit that I depend on a specific version and minor updates of a version, but not major updates (the definition of minor/major may be mine, such as "1...*"

or

b) can I link to a specific version and prevent from linking to any updates of that version? (I may want to link to 1.0.0.1 ONLY, and not pick up a 1.0.0.2 automatically)

I've attempted B by specifying:

RequiredModules = @(
         @{ModuleName = 'SomePublishedModule'; ModuleVersion = '1.0.0.1'; },
...

But I'm still picking up 1.0.0.2. Should that have worked, and I'm doing something wrong?

bormm commented 3 years ago

Have you found a answer for your question? Would also be interested in a solution.

vpopescu commented 3 years ago

It's been a while, but I think the issue was to use RequiredVersion instead of ModuleVersion in the above snippet.

Going to close this since it's been open for like forever.