JustinGrote / ModuleFast

A "fast and loose" way to install modules from Powershell Gallery quickly. Meant for CICD, not production
Other
77 stars 5 forks source link

🎉 Add Initial Prerelease Support and Enable Prerelease automatically if specified #12

Closed JustinGrote closed 9 months ago

JustinGrote commented 9 months ago

This pull request adds initial support for prerelease modules and enables the prerelease feature automatically if specified. It also includes updates to the Get-ModuleFastPlan function to filter and show prerelease modules based on user preferences.

johlju commented 9 months ago

My heart jumped when I saw this PR. But looking at the code in this change it looks like it is still not possible to specify just one of several modules passed to Get-ModuleFastPlan to return the latest prerelease, or to specify that one of several modules should return specific prerelease version. Was hoping it would close issue #7. But great of you getting initial prerelease support working! It will help other use-cases.

JustinGrote commented 9 months ago

@johlju yes, currently if you specify a prerelease spec for one module it is assumed you want prerelease for all modules. You can work around this by pinning your upper version e.g. 'Az<=3.2.0' and since prereleases sort below released versions, you will not see a prerelease e.g. 3.2.0-alpha1 in this case.

I'm thinking about incorporating a syntax like ! to flag individual items as prerelease without requiring the whole thing to operate on prerelease.

johlju commented 9 months ago

Yes using ! could work, but does it need to work on both the ModuleName and RequiredVersion in the module specification passed to Get-ModuleFastPlan?

E.g.:

JustinGrote commented 9 months ago

It would be on modulename most likely and I will probably use instead of ! because is not a valid filename character and thus not a valid module character.

Note there are many more ways to specify a modulespec now such as nuget syntax: https://github.com/JustinGrote/ModuleFast/blob/3a432010bb75d1932d5531b65e61209ae713bfc9/ModuleFast.tests.ps1#L152-L220