Skip to main content

Send-ToastNotification

SYNOPSIS

Sends a Windows toast notification.

SYNTAX

Send-ToastNotification [-Message] <String> [[-Sender] <String>] [[-ComputerName] <String[]>] [-Title <String>]
[-AudioSource <String>] [-ShortDuration] [-RequireDismiss]
[<CommonParameters>]

DESCRIPTION

Builds and displays a Windows toast notification locally or through PowerShell remoting. The notification can include sender and title text, a supported sound, and duration or dismissal behavior.

EXAMPLES

EXAMPLE 1

Send-ToastNotification -Message 'Maintenance begins in 15 minutes.' -Title 'Maintenance'

Displays a local toast notification with a title and message.

EXAMPLE 2

Send-ToastNotification -Message 'Restart required.' -ComputerName 'SERVER01' -RequireDismiss

Sends a dismissible notification to SERVER01 through PowerShell remoting.

PARAMETERS

-Message

Specifies the Message value.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Sender

Specifies the Sender value.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ComputerName

Specifies the name of one or more computers.

Type: String[]
Parameter Sets: (All)
Aliases: Host, Name, Computer, CN

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Title

Specifies the Title value.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AudioSource

Specifies the Audio Source value.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: Ms-winsoundevent:Notification.Looping.Alarm3
Accept pipeline input: False
Accept wildcard characters: False

-ShortDuration

Specifies whether to enable the Short Duration option.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-RequireDismiss

Specifies whether to enable the Require Dismiss option.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
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.

INPUTS

OUTPUTS

None

NOTES

ALIASES

None.

PLATFORM APPLICABILITY

Windows only. The platform-aware loader does not export this command on Linux or macOS.

POWERSHELL COMPATIBILITY

See PowerShell compatibility for the supported runtime policy. PowerShell 7.6 LTS is preferred.

https://docs.keldor.dev/powershell/keldor/Send-ToastNotification