RamblingCookieMonster / PSDepend

PowerShell Dependency Handler
MIT License
277 stars 75 forks source link

Adding support for pre-releases and semantic versioning (PowerShell Gallery) #111

Closed raandree closed 4 years ago

raandree commented 4 years ago

This fixes #68.

The code of System.Management.Automation.SemanticVersion has been taken from PowerShell 7 and slightly modified to run in PowerShell 5.

Setting Pester version to 4.10.1 as the tests are not working with Pester 5.

raandree commented 4 years ago

One thing just came to my mind. This is a braking change that prevents working with 4-digit version numbers. I can do a TryPrase to identify the kind of version we are dealing with and cast either to System.Version or S.M.A.SemanticVersion. Let's wait with the merge.

raandree commented 4 years ago

@RamblingCookieMonster, I have added compatibility for versions and semantic versions in 'PSGalleryModule.ps1'. I have added tests as well.

RamblingCookieMonster commented 4 years ago

On a quick pass this lgtm, and looks like error handling will make it a non-breaking change (you had mentioned this above)? If it's working for you, I'm good to merge!

raandree commented 4 years ago

Have just tested with the DscWorkshop all works as expected. Without adding a prelease version and / or using latest and parameter 'AllowPrerelease', the behavior does not change and nothing breaks.