ConnectWiseControlAPI icon indicating copy to clipboard operation
ConnectWiseControlAPI copied to clipboard

Error handling error 'GetResponseStream'

Open Luke-Williams9 opened this issue 4 years ago • 1 comments

InvokeCWCWebRequest.ps1 does not seem to handle Invoke-Webrequest errors properly when catching then. (# Issue Request, like 24)

This happens to me in Powershell 7, on Windows and Linux.

The error: "Connect-CWC: Method invocation failed because [System.Net.Http.HttpResponseMessage] does not contain a method named 'GetResponseStream'"

I ran into this when connecting to CWC with a user that has insufficient permissions.

Luke-Williams9 avatar Aug 29 '22 17:08 Luke-Williams9

Thanks for the report. The error handler now only calls GetResponseStream() on Windows PowerShell 5.x, so PowerShell 7 shows the real server error instead of this. The fix shipped in 0.4.0.0 on the Gallery. Closing; please reopen if you still hit it.

christaylorcodes avatar Nov 10 '26 16:11 christaylorcodes