After updating to Ps 4.0, I found some windows hosts are encountering the following errors when I run Invoke-Command to check the powershell version. See Fig-1.
Connecting to remote server X.X.X.X failed with the following error message : The WS-Management service cannot process the request. Cannot find the Microsoft.PowerShell session configuration in the WSMan: drive on the X.X.X.X computer.
After a few googling, I found that the problem is Default Powershell Configuration Session, Microsoft.powershell has been unregistered and there is only Microsoft.powershell.workflow registered. Check it by the following Ps command in elevated administrative mode. See Fig-2.
The solution is we need to re-register the default endpoint back. You can enter ‘A’ for all confirmations. This will only register the selected endpoint & restart the WinRM service. See Fig-2j.
Register-PSSessionConfiguration -Name Microsoft.powershell
Then you can check it if it successfully registered. See Fig-2.
Now, re-check you are able to connect the host. See Fig-3.