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
A ValueFromRemainingArguments parameter by default invariably receives a [List[object]] collection rather than a scalar / PowerShell array ([object[]]), as appropriate #4625
Declaring a (at most 1) parameter with attribute ValueFromRemainingArguments allows you to collect any remaining arguments - those not bound to other parameters - in a single parameter.
Given that there may be 1 or more remaining arguments, that would usually imply:
bind a scalar to the parameter if there's only one remaining argument
bind a regular PowerShell array ([object[]]), if there are multiple remaining arguments.
By contrast, a [List[object]] instance is currently bound, irrespective of whether 1 or more remaining arguments are bound.
Steps to reproduce
Create script t.ps1 in the current dir. with the following content:
PowerShell Core v6.0.0-beta.5 on macOS 10.12.6
PowerShell Core v6.0.0-beta.5 on Ubuntu 16.04.3 LTS
PowerShell Core v6.0.0-beta.5 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)
Windows PowerShell v5.1.15063.483 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)
Related: #3773 and #3154
Declaring a (at most 1) parameter with attribute
ValueFromRemainingArgumentsallows you to collect any remaining arguments - those not bound to other parameters - in a single parameter.Given that there may be 1 or more remaining arguments, that would usually imply:
[object[]]), if there are multiple remaining arguments.By contrast, a
[List[object]]instance is currently bound, irrespective of whether 1 or more remaining arguments are bound.Steps to reproduce
Create script
t.ps1in the current dir. with the following content:Then call:
Expected behavior
Actual behavior
Environment data