chocolatey / cChoco

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

Add Required/Minimum/Maximum for Version #117

Closed mrhockeymonkey closed 4 years ago

mrhockeymonkey commented 5 years ago

At work I currently use a forked version of this DSCResource that we have added to, One of these additions is to add some options for the case of a more recent version of a package being installed. In this instance we sometimes want to accept this higher version as okay. Much like the way Import-Module has parameters -Version, -RequiredVersion, -MinimumVersion and -MaximumVersion to give the user more control over their environment.

Example

# will return as in desired state if any version greater to or equal than 1.2.3 is found
cChoco MyApp {
  Name= 'MyApp'
  MinimumVersion = '1.2.3'
}

If I get a PR put together would there be any appetite to merge in such a feature? The idea will be to add optional parameters and not affect the default behavior.

pauby commented 5 years ago

I this would be a useful enhancement. For those using it in anger it would be great to hear from them.

ethanbergstrom commented 4 years ago

I would note that this functionality is possible using the PackageManagement DSC resources, which when combined with the Chocolatier package manager, provides the same result as what you're describing.

mrhockeymonkey commented 4 years ago

Good to know, I will have a play with Chocolatier when I can. I think its worth having this feature in the DSC resource too for completeness.