JustinGrote / ModuleFast

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

Prerelease Versions with string syntax incorrectly cast to [System.Version] #88

Closed Jaykul closed 1 week ago

Jaykul commented 1 month ago

Right now, if you run:

Find-PSResource ModuleBuilder -Prerelease

The current prerelease is:

Name          Version Prerelease           Repository Description
----          ------- ----------           ---------- -----------
ModuleBuilder 3.2.0   scriptgenerators0009 PSGallery  A module for authoring and building PowerShell modules

But if I try to use the pre-release with Install-ModuleFast, I can't find a way to do it without accepting pre-release of everything

I would expect any of these to work:

Install-modulefast "ModuleBuilder:[3.2.0-scriptgenerators0009, 4.0)"
install-modulefast "ModuleBuilder>=3.2.0-alpha"
install-modulefast "ModuleBuilder>=3.2-alpha"

Currently, the only way I can find to install it is to explicitly use the -Prerelease switch:

install-modulefast "ModuleBuilder>3.1" -Prerelease
JustinGrote commented 1 week ago

Thanks for the submission, I see my test succeeds but can confirm yours doesn't, time to see what's different between ModuleBuilder and PrereleaseTest

JustinGrote commented 1 week ago

Seems to be an issue when the module is already installed. If not installed it doesn't happen, something in that compare logic isn't working right. image

JustinGrote commented 1 week ago

@Jaykul found it, simple oopsie when doing a local version compare against a prerelease install. Should be good now.