When multiple module versions are detected in the Get-AvailableModuleVersion private function of the AWS.Tools.Installer module, Find-Module is called again without the MaximumVersion parameter, but it should use a splat for expanding the $findModuleParams hash table instead of passing it as a positional parameter.
Current Behavior
When multiple module versions are detected in the Get-AvailableModuleVersion private function of the AWS.Tools.Installer module, Find-Module is called again without the MaximumVersion parameter on Line 250, but it passes the $findModuleParams hash table as a positional parameter (which is not acceptable for the cmdlet), instead of as a splat like on Line 237.
Possible Solution
250s/\$findModuleParams/@findModuleParams/
Steps to Reproduce (for bugs)
PS C:\> Install-AWSToolsModule -Name 'AWS.Tools.*'
ForEach-Object : A positional parameter cannot be found that accepts argument 'System.Collections.Hashtable'.
At ~\Documents\PowerShell\Modules\AWS.Tools.Installer\1.0.0.0\AWS.Tools.Installer.psm1:250 char:37
+ ... s = $Name | ForEach-Object { Find-Module -Name $_ $findModuleParams @ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [ForEach-Object], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.ForEachObjectCommand
Context
Causes an unexpected error when attempting to use a wildcard. Wildcards are not supported yet, but discovered this bug while working on a PR for #72 #73.
Your Environment
Include as many relevant details about the environment where the bug was discovered.
Affected module (AWSPowerShell, AWSPowerShell.NetCore or AWS.Tools.*): AWS.Tools.Installer
Module version as reported by Get-AWSPowerShellVersion: 1.0.0.0
Operating System and version as reported by $PSVersionTable.OS: Microsoft Windows 10.0.17763
PowerShell version as reported by $PSVersionTable.PSEdition: Core
Expected Behavior
When multiple module versions are detected in the Get-AvailableModuleVersion private function of the AWS.Tools.Installer module,
Find-Module
is called again without theMaximumVersion
parameter, but it should use a splat for expanding the$findModuleParams
hash table instead of passing it as a positional parameter.Current Behavior
When multiple module versions are detected in the Get-AvailableModuleVersion private function of the AWS.Tools.Installer module,
Find-Module
is called again without theMaximumVersion
parameter on Line 250, but it passes the$findModuleParams
hash table as a positional parameter (which is not acceptable for the cmdlet), instead of as a splat like on Line 237.Possible Solution
250s/\$findModuleParams/@findModuleParams/
Steps to Reproduce (for bugs)
Context
Causes an unexpected error when attempting to use a wildcard. Wildcards are not supported yet, but discovered this bug while working on a PR for #72 #73.
Your Environment
Include as many relevant details about the environment where the bug was discovered.
Get-AWSPowerShellVersion
: 1.0.0.0$PSVersionTable.OS
: Microsoft Windows 10.0.17763$PSVersionTable.PSEdition
: Core