Send-PodeSignal
SYNOPSIS
Broadcasts a message to one or more Signal (WebSocket) connections.
SYNTAX
Send-PodeSignal [[-Data] <Object>] [-Name <String[]>] [-Group <String[]>] [-ClientId <String[]>]
[-Depth <Int32>] [-Mode <String>] [-IgnoreEvent] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Send a message to one or more Signal connections. This can either be: - Every client for a Signal connection Name - Specific ClientIds for a Signal connection Name - The current Signal connection being referenced within $WebEvent.Signal
EXAMPLES
EXAMPLE 1
Send-PodeSignal -Data @{ Message = 'Hello, world!' }
EXAMPLE 2
Send-PodeSignal -Data @{ Data = @(123, 100, 101) } -Name '/response-charts'
PARAMETERS
-ClientId
An optional array of 1 or more Signal connection ClientIds to send messages to, for the specified Signal connection Name.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Data
The Data for the message being sent, either as a String or a Hashtable/PSObject. If the latter, it will be converted into JSON.
Type: Object
Parameter Sets: (All)
Aliases: Value
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-Depth
The Depth to generate the JSON document - the larger this value the worse performance gets.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 10
Accept pipeline input: False
Accept wildcard characters: False
-Group
An optional array of 1 or more Signal connection Groups to send messages to, for the specified Signal connection Name.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IgnoreEvent
If supplied, any WebEvent/SignalEvent will be ignored.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Mode
The Mode to broadcast a message: Auto, Broadcast, Direct. (Default: Auto). Legacy parameter, purely here for backwards compatibility. - Auto: (Recommended) Decides whether to broadcast or send directly based on the context of the call. - Broadcast: Always broadcast the message to the specified Name/Group/ClientIds. - Direct: Always send the message directly back to the current Signal connection.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Auto
Accept pipeline input: False
Accept wildcard characters: False
-Name
An Signal connection Name - multiple may be supplied.
Type: String[]
Parameter Sets: (All)
Aliases: Path
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.