@@ -223,7 +223,9 @@ These will be appended onto the `-SocketUrl`.
223
223
| ` [IDictionary] ` | false | named | true (ByPropertyName)|
224
224
225
225
#### ** Handler**
226
- A ScriptBlock that will handle the output of the WebSocket.
226
+ A ScriptBlock that can handle the output of the WebSocket or the Http Request.
227
+ This may be run in a separate ` -Runspace ` or ` -RunspacePool ` .
228
+ The output of the WebSocket or the Context will be passed as an object.
227
229
228
230
| Type | Required| Position| PipelineInput|
229
231
| ---------------| --------| --------| -------------|
@@ -274,10 +276,12 @@ The buffer size. Defaults to 16kb.
274
276
| ` [Int32] ` | false | named | false |
275
277
276
278
#### ** Broadcast**
279
+ If provided, will send an object.
280
+ If this is a scriptblock, it will be run and the output will be sent.
277
281
278
- | Type | Required| Position| PipelineInput|
279
- | ------------| --------| --------| -------------|
280
- | ` [PSObject] ` | false | named | false |
282
+ | Type | Required| Position| PipelineInput| Aliases |
283
+ | ------------| --------| --------| -------------| ------- |
284
+ | ` [PSObject] ` | false | named | false | Send |
281
285
282
286
#### ** OnConnect**
283
287
The ScriptBlock to run after connection to a websocket.
@@ -460,8 +464,8 @@ RunspacePools allow you to limit the scope of the handler to a pool of runspaces
460
464
461
465
### Syntax
462
466
``` PowerShell
463
- Get-WebSocket [[-SocketUrl] <Uri>] [-QueryParameter <IDictionary>] [-ForwardEvent] [-Variable <IDictionary>] [-Header <IDictionary>] [-Name <String>] [-InitializationScript <ScriptBlock>] [-BufferSize <Int32>] [-Broadcast <PSObject>] [-OnConnect <ScriptBlock>] [-OnError <ScriptBlock>] [-OnOutput <ScriptBlock>] [-OnWarning <ScriptBlock>] [-Authenticate <PSObject>] [-Handshake <PSObject>] [-Watch] [-RawText] [-Binary] [-Force] [-SubProtocol <String>] [-Filter <PSObject[]>] [-WatchFor <IDictionary>] [-TimeOut <TimeSpan>] [-PSTypeName <String[]>] [-Maximum <Int64>] [-ThrottleLimit <Int32>] [-ConnectionTimeout <TimeSpan>] [-Runspace <Runspace>] [-RunspacePool <RunspacePool>] [-IncludeTotalCount] [-Skip <UInt64>] [-First <UInt64>] [<CommonParameters>]
467
+ Get-WebSocket [[-SocketUrl] <Uri>] [-QueryParameter <IDictionary>] [-Handler <ScriptBlock>] [- ForwardEvent] [-Variable <IDictionary>] [-Header <IDictionary>] [-Name <String>] [-InitializationScript <ScriptBlock>] [-BufferSize <Int32>] [-Broadcast <PSObject>] [-OnConnect <ScriptBlock>] [-OnError <ScriptBlock>] [-OnOutput <ScriptBlock>] [-OnWarning <ScriptBlock>] [-Authenticate <PSObject>] [-Handshake <PSObject>] [-Watch] [-RawText] [-Binary] [-Force] [-SubProtocol <String>] [-Filter <PSObject[]>] [-WatchFor <IDictionary>] [-TimeOut <TimeSpan>] [-PSTypeName <String[]>] [-Maximum <Int64>] [-ThrottleLimit <Int32>] [-ConnectionTimeout <TimeSpan>] [-Runspace <Runspace>] [-RunspacePool <RunspacePool>] [-IncludeTotalCount] [-Skip <UInt64>] [-First <UInt64>] [<CommonParameters>]
464
468
```
465
469
``` PowerShell
466
- Get-WebSocket -RootUrl <String[]> [-Route <IDictionary>] [-HTML <String>] [-PaletteName <String>] [-GoogleFont <String>] [-CodeFont <String>] [-JavaScript <String[]>] [-ImportMap <IDictionary>] [-Handler <ScriptBlock>] [-Variable <IDictionary>] [-Header <IDictionary>] [-Name <String>] [-InitializationScript <ScriptBlock>] [-BufferSize <Int32>] [-Broadcast <PSObject>] [-Force] [-TimeOut <TimeSpan>] [-Maximum <Int64>] [-ThrottleLimit <Int32>] [-IncludeTotalCount] [-Skip <UInt64>] [-First <UInt64>] [<CommonParameters>]
470
+ Get-WebSocket -RootUrl <String[]> [-Route <IDictionary>] [-HTML <String>] [-PaletteName <String>] [-GoogleFont <String>] [-CodeFont <String>] [-JavaScript <String[]>] [-ImportMap <IDictionary>] [-Handler <ScriptBlock>] [-Variable <IDictionary>] [-Header <IDictionary>] [-Name <String>] [-InitializationScript <ScriptBlock>] [-BufferSize <Int32>] [-Broadcast <PSObject>] [-Force] [-TimeOut <TimeSpan>] [-Maximum <Int64>] [-ThrottleLimit <Int32>] [-Runspace <Runspace>] [-RunspacePool <RunspacePool>] [- IncludeTotalCount] [-Skip <UInt64>] [-First <UInt64>] [<CommonParameters>]
467
471
```
0 commit comments