BurntToast PowerShell Module
repository·main·Indexed 23 days ago
https://github.com/windos/burnttoastA PowerShell module for displaying Windows Toast Notifications on Windows 10 and Windows Server 2019 or newer. It provides functions to create notification bindings, audio objects, and interactive actions including buttons, input controls, and progress bars. The module utilizes the Microsoft.Toolkit.Uwp.Notifications library and includes utilities like Get-BTHeader and Get-BTHistory to manage notifications in the Windows Action Center.
What's inside BurntToast
- BurntToast is a PowerShell module designed for displaying Toast Notifications on Windows 10 and Windows Server 2019 and above.
Configure Determinate vs Indeterminate progress bars
mainYou can choose between two modes for the progress bar:
Determinate (Percentage-based): Use the
-Valueparameter with aDoublebetween0and1. You can optionally use-ValueDisplayto show custom text instead of the percentage.New-BTProgressBar -Status 'Copying files' -Value 0.2 -ValueDisplay '4/20 files complete'Indeterminate (Animation-based): Use the
-Indeterminateswitch. This is useful when the exact completion time or percentage is unknown.New-BTProgressBar -Status 'Copying files' -Indeterminate
Install BurntToast via Chocolatey
mainIf you use the Chocolatey package manager, you can install the BurntToast PowerShell module using the
choco installcommand.choco install burnttoast-psmoduleInstall BurntToast via PowerShell Gallery
mainTo install the BurntToast module directly from the PowerShell Gallery, use the
Install-Modulecommand.Install-Module -Name BurntToastCreate a Windows shortcut with New-BTShortcut
mainTo ensure toast notifications display your custom app name and icon (registered via
New-BTAppId), you must launch PowerShell or a compatible host from a shortcut that has theAppUserModelIDproperty set.New-BTShortcutautomates the creation of this shortcut.Important: After creating the shortcut, you must launch PowerShell exclusively via this shortcut to guarantee Windows uses your custom branding for actionable toast notifications.
New-BTShortcut -AppId "Acme.MyApp" -DisplayName "My App PowerShell" -IconPath "C:\Path\To\MyIcon.ico"Add buttons to a notification
mainTo add interactive buttons to a notification, create a button object using
New-BTButtonand pass it to the-Buttonparameter ofNew-BurntToastNotification.$btn = New-BTButton -Content 'Google' -Arguments 'https://google.com' New-BurntToastNotification -Text 'New Blog!' -Button $btnInclude a progress bar in a toast binding
mainYou can include a progress bar in your notification by creating a progress bar object with
New-BTProgressBarand passing it to the-Childrenparameter ofNew-BTBinding.$progress = New-BTProgressBar -Title 'Updating' -Status 'Running' -Value 0.4 $binding = New-BTBinding -Children $progressAdd a header to a notification
mainTo categorize or group notifications, create a header object using
New-BTHeaderand pass it to the-Headerparameter ofNew-BurntToastNotification.$header = New-BTHeader -Id '001' -Title 'Updates' New-BurntToastNotification -Text 'Major Update Available!' -Header $headerAdd attribution text to a notification
mainOn modern versions of Windows, you can add attribution text to the bottom of a notification using the
-Attributionparameter.New-BurntToastNotification -Text 'Integration Complete' -Attribution 'Powered by BurntToast'Create a single column layout with New-BTColumn
mainYou can use
New-BTColumnto wrap individual elements for structured layouts. This is useful when passing a column toNew-BTBinding.# Example 2: Wrapping a single text element in a column $label = New-BTText -Text 'Now Playing' $col = New-BTColumn -Children $label New-BTBinding -Children $label -Column $colCreate a button with an icon image
mainYou can display an image icon next to the button label by providing a path or URI to the
-ImageUriparameter.$pic = 'C:\temp\example.png' New-BTButton -Content 'View Picture' -Arguments $pic -ImageUri $picUse system-handled Snooze and Dismiss actions
mainTo add standard system-handled Snooze and Dismiss buttons to a notification, use the
-SnoozeAndDismissswitch. Note that this parameter set is mutually exclusive with custom actions like buttons or inputs.New-BTAction -SnoozeAndDismiss