PowerShell / PackageManagementProviderResource

Modules with DSC resources for the PackageManagement(aka OneGet) providers.
MIT License
37 stars 24 forks source link

Resource that supports any package-provider (Install-Package wrapper). #6

Closed JVimes closed 8 years ago

JVimes commented 8 years ago

It seems like only the NuGet and PSModule package providers are supported. Chocolatey, MSU, MSI, Programs, and custom providers don't seem to be. Rather than write a resource for each provider, why not have a single resource that installs packages from any specified provider? This would essentially be a wrapper for Install-Package.

jianyunt commented 8 years ago

JVimes, only Nuget and PSModule providers are currently supported. Good suggestion. I thought about this approach before. The primary problem with this approach I considered before was that, each provider can have its own cmdlet properties. We could use optional arguments for these. But multiple PackageManagement properties will be ended up in optional arguments. Not so explicit. However with more and more providers available in the PackageManagement, this approach seems to have more benefit. I will give it re-think for this project. Again, thank you for your proposal.

mrpullen commented 8 years ago

what would be really nice is if we could specify all the parameters using a hashtable and splatting. That way depending on the package, we would just add / remove elements from the hashtable..

Install-Package testPkg { Name = "somename" Source = "somesource" Version = "someversion" AdditionalProperties = @{ } Params = "someparams" }

This could simplify the implementation of the DSC resource, will enabling us to have an arbitrarily large set of properties.

Would also like to see a Params = "" flag so I can pass specific configuration information to chocolatey packages or other packages. Would be really awesome if we could get a standard param mechanism/format for chocolatey packages (not the place here), like a jsonstring and inside choco we could convert to a hashtable, then build a string, or whatever the specific package needs.

jianyunt commented 8 years ago

@mrpullen. Good suggestion. First I will update this resource to work with WMF 5.0 RTM once it is released. Then I will consider all these good suggestions to this project. thx again.

Krishna-Vutukuri commented 8 years ago

I've added this support. Please check out the code in master branch. The module is downloadable from gallery as well: https://www.powershellgallery.com/packages/PackageManagementProviderResource/1.0.3