Error when using ConfigurationName parameter with Enter-PSSession
System Details
- Operating system name and version: Windows 8.1
- VS Code version: 1.17.0
- PowerShell extension version: 1.4.3
- Output from
$PSVersionTable: 5.0.10586.117
Issue Description
I am experiencing a problem with using the ConfigurationName parameter with the Enter-PSSession cmdlet. If I specify a configuration name when using Enter-PSSession I receive the following error:
Enter-PSSession : Object reference not set to an instance of an object. At line:1 char:1
- Enter-PSSession -ComputerName server01.domain.com -Credential ( ...
-
+ CategoryInfo : NotSpecified: (:) [Enter-PSSession], NullReferenceException + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.EnterPSSessionCommand
If I use New-PSSession and specify a configuration name the session is created, however, if I then use Enter-PSSession to access that session I receive the same error message.
If I do not specify a configuration name the commands work as expected. The commands also run successfully in PowerShell ISE.
@Nibushi It looks like that NRE is coming from within the Enter-PSSession call. It's worth noting that PowerShell 5.0 has been superceded and you should be using PowerShell 6.1 or 5.1.
If you've hit this again recently, a stack trace is the best place to start.
It should be present under something like $error[0].Exception.StackTrace.
Closing this issue as inactive, will re-open if this is still an issue.