Invoke-Command OutVariable Parameter - by Fitzroy87

Status : 


Sign in
to vote
ID 775921 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 1/6/2013 2:07:28 PM
Access Restriction Public


Does the 'OutVariable' parameter of Invoke-Command work in PS 2.0?

In this example, $EC should contain the value returned by '$?':

Invoke-Command {& calc;$?} -OutVariable EC
write-host $EC

It works as expected in PS 3.0 (tested on Windows 7) but the $EC variable doesn't get created when run on PS 2.0 (tested on Windows XP & Windows 7).
Sign in to post a comment.