We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
> [Collections.Generic.List[int]]@(1)
or
> [Management.Automation.LanguagePrimitives]::ConvertTo(@(1), [Collections.Generic.List[int]])
Note that casting @(1,2) will succeed. Only the case @(1) fails. This is a regression because it functions correctly in v4.
Casts to an instance of List<int> containing a single element: 1
List<int>
Exception calling "ConvertTo" with "2" argument(s): "Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Int32"."
> $PSVersionTable Name Value ---- ----- PSVersion 5.0.10586.494 PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.10586.494 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
Steps to reproduce
or
Note that casting @(1,2) will succeed. Only the case @(1) fails. This is a regression because it functions correctly in v4.
Expected behavior
Casts to an instance of
List<int>containing a single element: 1Actual behavior
Exception calling "ConvertTo" with "2" argument(s): "Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Int32"."Environment data