Make PackageName default to ChocolateyPackageName
Following helpers have a parameter -PackageName:
Install-ChocolateyZipPackageGet-ChocolateyUnzip
When they are used in install scripts (which is likely to be the case), this parameter seems redundant since we already have $env:ChocolateyPackageName. It would be great to let it default to $env:ChocolateyPackageName when this environment variable is available.
Sounds like a good idea. Have added this to up for grabs.
I am a new contributor to this project and was wondering if I could be assigned this issue.
I'm going to look into this as a first issue. Please let me know if this is no longer relevant or desired.
Would this change not also apply to Install-ChocolateyPackage as well?
Would this change not also apply to
Install-ChocolateyPackageas well?
Yes I think so! Thank you for your Pull Request.
Added this default value for several other scripts that use $packageName. If this is an optional parameter now that it has a default variable, shouldn't it not be in position 0? The problem is if we change the position, it breaks the API for other calling scripts.
The problem is if we change the position, it breaks the API for other calling scripts.
Yes, that would be a breaking change. Although it sounds nice to have optional parameters after all the required ones, it’s not worth it to break packages, especially corporate internal ones (we are able to update the community feed ourselves).
Note that we already have some of such “wrong parameters”, like -Url parameter of Install-ChocolateyZipPackage, for the same reason I guess.