Closed RamblingCookieMonster closed 4 years ago
Maybe supporting DSC as a Dependency type via Invoke-DSCResource
is a more generic option here.
The main drawbacks I can think of are:
The advantage is that it allows to then extending the Dependency Types by proxying the DSC Dependency type (i.e. creating a Choco dependency type by proxying the DSC Dependency type on the Choco DSC resource). Thus leveraging all the existing DSC Resources...
Maybe a fully fledged DSC dependency can be created using the LCM (hence supporting Composite resource), but that sounds a bit more work.
So! If we end up creating a chocolatey dependency type, I'm inclined to include a test/bootstrap bit in the dependency script.
Given that folks can preload (we'll include a param for path that defaults to choco command resolution path), any concern simply calling the standard install script in the off case a bootstrap is needed?
Good idea, but I think that script is missing 1 feature: a configurable Nuget server (say you want to install from a local feed, and retrieve the latest versions).
It's possible to extract that and populate the $Env:chocolateyDownloadUrl
, but making it a bit more transparent to the user would be nice.
for other functions, I wrote a few here that could help out: https://github.com/gaelcolas/PackageProviderBootstrap/tree/master/PackageProviderBootstrap/public
FWIW, I re-wrote the Install script and that module for Chocolatey + DSC here: https://github.com/gaelcolas/Chocolatey/
So to bootstrap you could use Install-ChocolateySoftware
(it defaults to https://chocolatey.org/api/v2 but you can override to your internal NuGet feed). Beware, that file has dependency on 2 other file/functions.
At that point, I wonder if it's not worth implementing a DSC Dependency type instead, so that could just use this chocolatey module directly...?
Thinking of this way, way late, but @ferventcoder might have thoughts on this.
We support PackageManagement, but, that's not exactly recommended over choco.exe at the moment.