You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When calling Invoke-SNOWWebRequest in PS Core 7.3.x, a ParameterBindingException is thrown. This is because the following code is used to determine which parameter name to use (due to the breaking change in PS Core version 7.4.0)
Invoke-WebRequest:
Line |
1405 | … Invoke-WebRequest @PSBoundParameters @ProxyAuth @TimeoutSplat -UseBas …
| ~~~~~~~~~~~~~
| A parameter cannot be found that matches parameter name 'OperationTimeoutSeconds'.
PS C:\Users\[username]> $PSVersionTable.PSVersion
PS C:\Users\[username]> (Get-Command "Invoke-WebRequest" | Select -Expand Parameters).Keys -match 'TimeoutSec'
TimeoutSec
PS C:\Users\[username]> 'TimeoutSec' -in (Get-Command "Invoke-WebRequest" | Select -Expand Parameters).Keys
True
PS C:\Users\[username]> 'OperationTimeoutSeconds' -in (Get-Command "Invoke-WebRequest" | Select -Expand Parameters).Keys
False
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 3 4
Expected behavior
The cmdlet should default to using TimeoutSec which is still present in 7.3. The below adjustment to the boolean check will resolve it:
Describe the bug
When calling
Invoke-SNOWWebRequest
in PS Core 7.3.x, aParameterBindingException
is thrown. This is because the following code is used to determine which parameter name to use (due to the breaking change in PS Core version 7.4.0)To Reproduce
Steps to reproduce the behavior:
(will only throw the error in PS 7.3.x)
Expected behavior
The cmdlet should default to using
TimeoutSec
which is still present in 7.3. The below adjustment to the boolean check will resolve it:Old:
New:
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: