Windows PowerShell Home
Get-PSSession returns incorrect state for robust sessions
5/13/2013 7:38:41 PM
User(s) can reproduce this bug
The background story is I am following 'Fun with PowerShell v3 “Robust Sessions”' in Runbooks to test robust sessions with System Center Orchestrator. But during the test I just found Get-PSSession returns incorrect state for robust sessions. You may verify this issue by following the repro steps.
How often does this happen?
Have you seen this problem before in this product?
No, this is new to the most recent version
1. Open Windows PowerShell ISE.
2. Open Windows PowerShell console.
3. Create a robust session by running following command in Windows PowerShell console:
a. New-PSSession -ComputerName .
4. Open Windows PowerShell ISE, get robust sessions by running following command:
a. Get-PSSession -ComputerName .
5. Since the output indicates the session robust session is disconnected, so I use Connect-PSSession to connect the "disconnected" session. And finally I confused by the error message.
"Connect-PSSession : Cannot connect PSSession "Session1" because it is not in Disconnected state or is not available for connection."
Get-PSSession should return correct state for robust sessions
to post a comment.
Please enter a comment.
on 5/13/2013 at 7:53 PM
GetPSSession.zip contains the repro steps that recorded by Step Recorder.
robustsessions.png is a screenshot for the error message.
to post a workaround.
Please enter a workaround.
© 2014 Microsoft