choco
choco copied to clipboard
Add support to `Install-ChocolateyFileAssociation` for multiple file extensions
Moving discussion from the old chocolatey issue 683 for function Install-ChocolateyFileAssociation
Summary
- allow callers to send multiple file extensions instead of calling this method n times for n file extension associations.
- change param
string $extension
tostring[] $extensions
- existing code will out in the wild will work because of parameter name disambiguation.
extension
is sufficient enough to be disambiguated toextensions
, just asext
would too. - change function to iterate through
$extensions
one by one and use existing code with no changes
A minor nitpick: PowerShell convention for parameter naming is to always use singular nouns, even in case of arrays. Therefore, I'd recommend against the name change.
Extension
should be able to take a string or an array of strings. I agree with @jberezanski, PowerShell uses singular nouns and the parameter shouldn't be renamed.
Any change made to the PowerShell helper will also need to be made in Chocolatey Licensed.