-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionResolution-AnsweredThe question is answered.The question is answered.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
Note: Also affects other common parameters: see #3773
Steps to reproduce
$null = Get-Date -OutVariable ov; $ov.GetType().FullNameExpected behavior
Type name System.DateTime
Actual behavior
Type name System.Collections.ArrayList
That is, the single-object output stored in the variable targeted with -OutVariable received an array list rather than a scalar (the single-element collection wasn't unwrapped).
Also, it is type [System.Collections.ArrayList] that is always used, in contrast with the [System.Object[]] instances you get with regular assignments.
See also: http://stackoverflow.com/a/40666568/45375
Environment data
PowerShell v6.0.0-alpha (v6.0.0-alpha.15) on Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64
PowerShell v5.1.14393.693 on Microsoft Windows 10 Pro (64-bit; v10.0.14393)amervitz, Meir017, marckassay, wisemoth, LuanVSO and 1 moreJaykul, daxian-dbw, jkavanagh58 and bergmeisterJaykul, jkavanagh58 and ratijas
Metadata
Metadata
Assignees
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionResolution-AnsweredThe question is answered.The question is answered.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime