< Back

New-BTText

Sun Jan 12, 2020 7:41 pm

NAME New-BTText



SYNOPSIS

Creates a new Text Element for Toast Notifications.





SYNTAX

New-BTText [[-Text] <String>] [[-MaxLines] <Int32>] [[-MinLines] <Int32>] [-Wrap] [[-Align] {Default | Auto | Left

| Center | Right}] [[-Style] {Default | Caption | CaptionSubtle | Body | BodySubtle | Base | BaseSubtle | Subtitle

| SubtitleSubtle | Title | TitleSubtle | TitleNumeral | Subheader | SubheaderSubtle | SubheaderNumeral | Header |

HeaderSubtle | HeaderNumeral}] [[-Language] <String>] [-Bind] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

The New-BTText function creates a new Text Element for Toast Notifications.



You can specify the text you want displayed in a Toast Notification as a string, or run the function without a

paramter for a blank line.



Each Text Element is the equivalent of one line in on a Toast Notification, long lines will wrap.





PARAMETERS

-Text <String>

The text to display. Data binding support added in Creators Update, only works for toast top-level text

elements (But appears to not be working via PowerShell yet.)



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-MaxLines <Int32>

The maximum number of lines the text element is allowed to display. For Toasts, top-level text elements will

have varying max line amounts (and in the Anniversary Update you can change the max lines).



Text on a Toast inside a group (not yet implemented) will behave identically to Tiles (default to infinity).



Required? false

Position? 2

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-MinLines <Int32>

The minimum number of lines the text element must display. Note that for Toast, this property will only take

effect if the text is inside a group (not yet implemented.)



Required? false

Position? 3

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Wrap [<SwitchParameter>]

Supply this switch to enable text wrapping. For Toasts, this is true on top-level text elements, and false

inside a group (not yet implemented.)



Note that for Toast, setting wrap will only take effect if the text is inside a group (you can use

HintMaxLines = 1 to prevent top-level text elements from wrapping).



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Align

The horizontal alignment of the text. Note that for Toast, this property will only take effect if the text is

inside a group (not yet implemented.)



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Style

The style controls the text's font size, weight, and opacity. Note that for Toast, the style will only take

effect if the text is inside a group (not yet implemented.)



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Language <String>

The target locale of the XML payload, specified as a BCP-47 language tags such as "en-US" or "fr-FR". The

locale specified here overrides any other specified locale, such as that in binding or visual. If this value

is a literal string, this attribute defaults to the user's UI language. If this value is a string reference,

this attribute defaults to the locale chosen by Windows Runtime in resolving the string.



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Bind [<SwitchParameter>]



Required? false

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

String



You cannot pipe input to this function.





OUTPUTS

Text





NOTES





TODO: Implement hint-style (https://blogs.msdn.microsoft.com/tiles_ ... e-template

s-schema-and-documentation/)



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:\\>New-BTText -Content 'This is a line with text!'



Creates a Text Element that will show the string 'This is a line with text!' on a Toast Notification.









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



PS C:\\>New-BTText



Creates a Text Element that will show a blank line on a Toast Notification.











RELATED LINKS

https://github.com/Windos/BurntToast/bl ... -BTText.md