For exchange the connection uri used is :
http://machineName/powershell
The WSManConnectionInfo object is created in the following way:
WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri("http://machineName/powershell"), "http://schemas.microsoft.com/powershell/Microsoft.Exchange", ExchangeCredential)
To connect to windows, the uri used is
http://machineName:5985/wsman
The WSManConnectionInfo object is created in the following way:
WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri("http://machineName:5985/wsman"), "http://schemas.microsoft.com/powershell/Microsoft.PowerShell", credential);
Why is there a difference in the connection uri for exchange and windows?