Skip to content

Commit 31df074

Browse files
StartAutomatingStartAutomating
authored andcommitted
docs: Get-WebSocket examples
1 parent 9bdfdc3 commit 31df074

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/Get-WebSocket.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Create a WebSocket job that connects to a WebSocket and outputs the results.
3131
```PowerShell
3232
$socketServer = Get-WebSocket -RootUrl "http://localhost:8387/" -HTML "<h1>WebSocket Server</h1>"
3333
$socketClient = Get-WebSocket -SocketUrl "ws://localhost:8387/"
34+
foreach ($n in 1..10) { $socketServer.Send(@{n=Get-Random}) }
35+
$socketClient | Receive-Job -Keep
3436
```
3537
Get is the default verb, so we can just say WebSocket.
3638
`-Watch` will output a continous stream of objects from the websocket.

0 commit comments

Comments
 (0)