< Back

New-BTAction

Sun Jan 12, 2020 7:27 pm

NAME New-BTAction



SYNOPSIS

Creates an action object for a Toast Notification.





SYNTAX

New-BTAction [-Buttons <IToastButton[]>] [-ContextMenuItems <ToastContextMenuItem[]>] [-Inputs <IToastInput[]>]

[-WhatIf] [-Confirm] [<CommonParameters>]



New-BTAction -SnoozeAndDismiss [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

The New-BTAction function creates an 'action' object which contains defines the controls displayed at the bottom

of a Toast Notification.



Actions can either be system handeled and automatically localized Snooze and Dismiss buttons or a custom

collection of inputs.





PARAMETERS

-Buttons <IToastButton[]>

Button objects created with the New-BTButton function. Up to five can be included, or less if Context Menu

Items are also included.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ContextMenuItems <ToastContextMenuItem[]>

Right click context menu item objects created with the New-BTContextMenuItem function. Up to five can be

included, or less if Buttons are also included.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Inputs <IToastInput[]>

Input objects created via the New-BTText and New-BTSelectionBoxItem functions. Up to five can be included.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SnoozeAndDismiss [<SwitchParameter>]

Creates a system handeled snooze and dismiss action. Cannot be included inconjunction with custom actions.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

You cannot pipe input to this function.





OUTPUTS

Microsoft.Toolkit.Uwp.Notifications.IToastActions





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-BTAction -SnoozeAndDismiss



This command creates an action element using the system handled snooze and dismiss modal.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-BTAction -Buttons (New-BTButton -Content 'Google' -Arguments 'https://google.com')



This command creates an action element with a single clickable button.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>$Button = New-BTButton -Content 'Google' -Arguments 'https://google.com'



$ContextMenuItem = New-BTContextMenuItem -Content 'Bing' -Arguments 'https://bing.com'

New-BTAction -Buttons $Button -ContextMenuItems $ContextMenuItem



This example creates an action elemnt with both a clickable button and a right click context menu item.











RELATED LINKS

https://github.com/Windos/BurntToast/bl ... TAction.md