< Back

New-BTContent

Sun Jan 12, 2020 7:32 pm

NAME New-BTContent



SYNOPSIS

Creates a new Toast Content object.





SYNTAX

New-BTContent [[-Actions] <IToastActions>] [[-ActivationType] {Foreground | Background | Protocol}] [[-Audio]

<ToastAudio>] [[-Duration] {Short | Long}] [[-Header] <ToastHeader>] [[-Launch] <String>] [[-Scenario] {Default |

Alarm | Reminder | IncomingCall}] [-Visual] <ToastVisual> [[-ToastPeople] <ToastPeople>] [[-CustomTimestamp]

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





DESCRIPTION

The New-BTContent function creates a new Toast Content object which is the Base Toast element, which contains at

least a visual element.





PARAMETERS

-Actions <IToastActions>

Optionally create custom actions with buttons and inputs (New-BTAction.)



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ActivationType

Specifies what activation type will be used when the user clicks the body of this Toast.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Audio <ToastAudio>

Specify custom audio options (New-BTAudio.)



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Duration

The amount of time the Toast should display. You typically should use the Scenario attribute instead, which

impacts how long a Toast stays on screen.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Header <ToastHeader>

New in Creators Update: Specifies an optional header for the toast notification (New-BTHeader.)



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Launch <String>

A string that is passed to the application when it is activated by the Toast. The format and contents of this

string are defined by the app for its own use. When the user taps or clicks the Toast to launch its associated

app, the launch string provides the context to the app that allows it to show the user a view relevant to the

Toast content, rather than launching in its default way.



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Scenario

Specify the scenario, to make the Toast behave like an alarm, reminder, or more.



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Visual <ToastVisual>

Specify the visual element object, created with the New-BTVisual function.



Required? true

Position? 8

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ToastPeople <ToastPeople>



Required? false

Position? 9

Default value

Accept pipeline input? false

Accept wildcard characters? false



-CustomTimestamp <DateTime>



Required? false

Position? 10

Default value

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





OUTPUTS

ToastContent





NOTES





Credit for most of the help text for this function go to the authors of the UWPCommunityToolkit library that

this module relies upon.



Please see the originating repo here: https://github.com/Microsoft/UWPCommunityToolkit



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



PS C:\\>$binding1 = New-BTBinding -Children $text1, $text2 -AppLogoOverride $image2



$visual1 = New-BTVisual -BindingGeneric $binding1

$content1 = New-BTContent -Visual $visual1



This example combines numerous objects created via BurntToast functions into a binding, then a visual element and

finally into a content object.



The resultant object can now be displayed using the Submit-BTNotification function.









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



PS C:\\>$content1 = New-BTContent -Visual $visual1 -ActivationType Protocol -Launch 'https://google.com'



This command takes a pre-existing visual object and also specifies options required to launch a browser on the

Google homepage when clicking the toast.











RELATED LINKS

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