Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(GH-1284) Install-ChocolateyPackage aliases File/File64
When passing File and FileType to Install-ChocolateyPackage, it can cause the following issue to occur: ~~~ ERROR: Cannot bind parameter because parameter 'fileType' is specified more than once. To provide multiple values to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,value3". ~~~ This is well documented at https://github.com/chocolatey/choco/wiki/Troubleshooting#error-cannot-bind-parameter-because-parameter-filetype-is-specified-more-than-once : ~~~powershell $toolsPath = $(Split-Path -parent $MyInvocation.MyCommand.Definition) $packageArgs = @{ packageName = 'test' fileType = 'MSI' file = "$toolsPath\somefile.msi" softwareName = 'test' silentArgs = '/qn /norestart' validExitCodes= @(0) } Install-ChocolateyPackage @packageArgs was meant to be used in this scenario ~~~ `Install-ChocolateyPackage` doesn't have both a `File` parameter and a `FileType` parameter. PowerShell has a "feature" where it does partial matching of parameters. When you splat the parameters in, it tries to apply both `File` and `FileType` to `FileType` and throws the above error. Correct this behavior by setting aliases
- Loading branch information