Home Dashboard Directory Help

Error when entering PSSession in ISE after update to v5 preview by holtonwes



Sign in
to vote
Type: Bug
ID: 851992
Opened: 4/12/2014 6:48:40 PM
Access Restriction: Public
User(s) can reproduce this bug


I'm getting the following error when trying to do "Enter-PSSession computername" in Powershell ISE after installing the v5 preview. It seems to only happen in ISE. Regular console is fine. I can also invoke-command without issue in ISE.

Enter-PSSession : Object reference not set to an instance of an object. At line:1 char:1 + Enter-PSSession jparagonntier01 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Enter-PSSession], NullReferenceException + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.EnterPSSessionCommand

Sign in to post a comment.
Posted by azhskr on 5/5/2014 at 9:32 AM
This is exactly what is happening to me as well.
Enter-PSSession -Session (New-PSSession -ComputerName blah.blah.com)
Enter-PSSession : Object reference not set to an instance of an object.

And then it enters me into the session and everything works fine. When I exit the PSSession I get the error below, but still exit the session.
[blah.blah.com]: PS C:\Users\Documents> Exit-PSSession
Exception has been thrown by the target of an invocation.

Even if I enter the session by doing the commands below, the same behavior occurs.
$session = New-PSSession -ComputerName blah.blah.com
Enter-PSSession $session

From the console everything works fine.
This is on Windows 8.1 x64
Sign in to post a workaround.
Posted by Adrian Rodiguez on 4/14/2014 at 6:21 AM
Create a PSSession using New-PSSession. Use Enter-PSSession to enter the previously configured session. You will now be entered into the session.
Posted by holtonwes on 4/12/2014 at 6:49 PM
Enter-PSSession works fine in standard Powershell console host.