File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,7 +255,11 @@ function Get-WebSocket {
255255 [Parameter (ParameterSetName = ' WebSocketClient' )]
256256 [Alias (' Authorize' , ' HelloMessage' )]
257257 [PSObject ]
258- $Authenticate ,
258+ $Authenticate ,
259+
260+ [Alias (' Identify' , ' AutoReply' )]
261+ [PSObject ]
262+ $Reply ,
259263
260264 # If set, will watch the output of the WebSocket job, outputting results continuously instead of outputting a websocket job.
261265 [Parameter (ParameterSetName = ' WebSocketClient' )]
@@ -428,7 +432,12 @@ function Get-WebSocket {
428432 $saidHello = $null
429433
430434 :WebSocketMessageLoop while ($true ) {
431- if ($ws.State -ne ' Open' ) {break }
435+ if ($ws.State -ne ' Open' ) {
436+ if ($ws.CloseStatusDescription ) {
437+ Write-Error $ws.CloseStatusDescription - TargetObject $ws
438+ }
439+ break
440+ }
432441 if ($TimeOut -and ([DateTime ]::Now - $webSocketStartTime ) -gt $TimeOut ) {
433442 $ws.CloseAsync ([Net.WebSockets.WebSocketCloseStatus ]::NormalClosure, ' Timeout' , $CT ).Wait()
434443 break
You can’t perform that action at this time.
0 commit comments