choco icon indicating copy to clipboard operation
choco copied to clipboard

Add support to `Install-ChocolateyFileAssociation` for multiple file extensions

Open philoushka opened this issue 9 years ago • 2 comments

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 to string[] $extensions
  • existing code will out in the wild will work because of parameter name disambiguation. extension is sufficient enough to be disambiguated to extensions, just as ext would too.
  • change function to iterate through $extensions one by one and use existing code with no changes

philoushka avatar Mar 10 '15 01:03 philoushka

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.

jberezanski avatar Mar 10 '15 21:03 jberezanski

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.

pauby avatar Dec 19 '23 13:12 pauby