Closed ferventcoder closed 8 years ago
@ferventcoder Already made a PR for this. See #50.
This takes only switch params right now. I could adjust it to take anykind of param. Accepting ANY param would break paramvalidation.
Another option would be to just wrap all chocolatey params in a single string.
@javydekoning I didn't see it allowed choco switch parameters - I see that now.
I totally meant something like $chocoSwitchParams
, but no mapping on what could be passed to it.
At the end of the day, instead of trying to keep track of all of the arguments that can be passed (you missed all of the pro/business edition switches/options by the way ;) ) and permutations of how those could be passed, the param could be a simple string array that passes those switches straight through and allows choco to validate them.
Very nice! I provided some comments on the PR.
Duplicate of #45 ?
@ferventcoder This would superseed #45 and #12 indeed.
Secondly, I have to agree with you here. I think I should change #50 and implement it your way. This way there is no validation in DSC but you are able to pass anything down to choco. @ebekker @lawrencegripper what do you guys think?
Sounds good to me as it would allow more flexibility for users and reduce maintenance overhead of the DSC resources. Loss of validation is a shame bit feels like a fair trade-off
Ok good, I'll re-write this somewhere later this week.
@ferventcoder so we have 2 options here:
1 - Array:
cChocoPackageInstaller skype
{
Name = "skype"
chocoParams = 'allowdowngrade',
'allowemptychecksum',
'execution-timeout=200'
Ensure = 'Present'
Version = '7.25.0.106'
PsDscRunAsCredential = $Credential
DependsOn = "[cChocoInstaller]installChoco"
}
2 - String:
cChocoPackageInstaller skype
{
Name = "skype"
chocoParams = '--allowdowngrade --allowemptychecksum --execution-timeout=200'
Ensure = 'Present'
Version = '7.25.0.106'
PsDscRunAsCredential = $Credential
DependsOn = "[cChocoInstaller]installChoco"
}
Either way it's going to be different from 'version' and 'Params'. I think that might be confusing to the user. I'm leaning towards the string option but it the array option looks a bit better in code.
@lawrencegripper @ebekker opinions?
I agree, the string option seems like the best route. Always a fan of keeping things simple, when appropriate, and it also keeps things consistent with the way in which the other package "params" option works too.
I'd say string. It mimics the way you actually work with choco - so makes it intuitive (in a way)
@javydekoning I like string.
Or both?
At least string.
Implemented as string. See PR #53
We would like to be able to pass through arguments directly to Chocolatey, without needing to add a parameter for each new option. Would you be keen to this?