If you get the following error when you try to connect to your WinRM client, try the command below:
Connecting to remote server failed with the following error message: The WinRM client received an HTTP server error status 502, from the remote ws-managment servic For more information, see the about_Remote_Troubleshooting Help topic. It was running the command 'Discover-ExchangeServer -UseWIA $true -SuppressError $true'.
Try the command below:
netsh winhttp reset proxy