chocolatey / cChoco

Community resource to manage Chocolatey
Apache License 2.0
154 stars 99 forks source link

(GH-117) Support specifying minimum package version #131

Closed mrhockeymonkey closed 4 years ago

mrhockeymonkey commented 5 years ago

As discussed in #117 here is support for specifying a minimum allowed version. Test-TargetResource returns true if the installed package version is greater or equal to that specified. This helps when user are given permission to update to the latest version of apps not yet specified in DSC.

Originally I had intended to include a MaxmimumVersion also but on reflection I don't have a use case for this so its probably better to not include it for no reason.

One caveat that i welcome feedback on is that when using MinimumVersion the test is carried out on [System.Version] objects as opposed to strings for the Version parameter. This could be confusing but I didn't want to alter the behaviors of Version as it is an existing feature. Let me know if you have any concerns about this.

mrhockeymonkey commented 5 years ago

Fixed the tests so I think this is ready to merge. I actually updated the script analyzer tests to emit a warning with some information on what issues script analyzer found to make it easier to spot. Im happy to remove this change if it is unwelcome though.

I think this is ready from my point of view. @pauby Let me know your thoughts

mrhockeymonkey commented 4 years ago

Apologies for leaving this to collect dust. I'll keep an eye out and await your feedback

pauby commented 4 years ago

Awesome work! Thanks for your contribution (and patience)!