Home Dashboard Directory Help
Search

Invoke-Command OutVariable Parameter by Fitzroy87


Status: 

Active


2
0
Sign in
to vote
Type: Bug
ID: 775921
Opened: 1/6/2013 2:07:28 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

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).
Details
Sign in to post a comment.
Sign in to post a workaround.