When trying to create a New-PSSession in PowerShell, you get this error:
Connecting to remote server (localhost) failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests…
To fix the client cannot connect to the destination specified in the request error, run the following PowerShell command as an administrator:
Using this command sets up WinRM to receive PowerShell commands and sets up a firewall exception to do the same. You will no longer have an issue connecting to the remote server (even if the remote server just happens to be the one you’re running the PowerShell command on!).