To enter a PowerShell remoting session:
Enter-PSSession -VMName NameOfVMI've played with this a bit before and it's pretty cool. I've never had any issues with it. However, today when working with some VMs provided for a course I'm working on I got longer version of this error when trying to connect:
Enter-PSSession : An error has occurred which Windows PowerShell cannot handle. A remote session might have ended.This same error message is provided if your authentication credentials fail. So, I reset the local administrator password on the VM, but no fix.
+ FullyQualifiedErrorId : CreateRemoteRunspaceForVMFailed,Microsoft.PowerShell.Commands.EnterPSSessionCommand
This was a generation 1 VM given to me. So, my first throught is that maybe its the generation of VM. Nope. I tested with other generation 1 and generation 2 VMs and all worked fine.
What it finally ended up being was the version of VM. The VM was built on a Windows Server 2012 R2 host. So, it was version 5 rather than version 7.1 for the VMs that I had created.
To view the version:
Get-VM | FT Name,VersionTo update the version:
Update-VMVersion NameOfVMAfter updating the VM to from version 5 to version 7.1 PowerShell Direct worked just like it is supposed to. This is worth noting because none of the articles about PowerShell Direct mention the version as a required.