BurntToast is a PowerShell module that allows creating modern-style pop-up notifications in Windows 10. With BurntToast, we can generate a notification and easily customize it with text, images, sounds, and interactive links.
It can also be used by developers to add notifications to their applications. We only have to launch a terminal command, so we can integrate it with a large number of technologies easily.
Add-Type -AssemblyName System.Windows.Forms
$NotifyIcon = [System.Windows.Forms.NotifyIcon]::new()
$NotifyIcon.ShowBalloonTip(5000, 'Title', 'Balloon Tip Text', 'Info')This should pop a notification up in the tray but nothing happens?
I tried this on two separate machines–one Windows 11 and one Windows 10, but it didn’t work on either.
Most of the search results reference the Windows.UI.Notifications namespace and something called “Toast” notifications. But I want to avoid using that since it requires additional dependencies and I know the NotifyIcon method has worked in the past.
So how can I accomplish this?
Nitish Kumar (नितीश कुमार)
Nitish Kumar (नितीश कुमार)
Infrastructure & Cloud specialist, O365, Azure, SSO, PowerShell, AD
What if you running a script which takes long time and covers various tasks, it can quickly get boring, and you don’t want to be staring on the screen and yet want to have some kind of visual feedback?
We know that PowerShell can do Progress bar, but this post would not be about that.
Recommended by LinkedIn
We can create balloon notifications within the script using a small custom function given below, which you can include on top of the script and call that wherever you need. These notifications can have types like Info, Warning, Error and would be displayed in taskbar with related icon and your custom message.
This function can be called something below this anywhere in the script and when during the processing of the script, it reaches to the point, then it would fire the notification.
New-BalloonNotification -title "The Notification from Nitish Kumar : " -message "Just trying out cool stuff" -icon Warning Also notice the script parameter, it can even run a script passed to the function if click on that balloon notification. Cool! right?
Insights from the community
Others also viewed
Explore topics
To start, I wanted to first create a simple toast notification just to see how it looks and how it’s done. This part was not hard at all as I found some documentation regarding the Toast Notification Manager on Microsoft website. I even searched a bit more and found this nice toast repository which contains examples for all types of the toast notifications you can create.
In my case I needed two buttons, so I figured out that the binding template that I had to use is the “ToastGeneric” one, so I grabbed this example over here:
So let us break down the code:
- XML Template (Toast Notification Definition): The
$xmlvariable holds the XML definition of the toast notification. It’s formatted using a Here-String (enclosed by@"and"@). The XML structure defines the appearance and content of the notification.<toast>: The root element of the toast notification.<visual>: Specifies the visual layout of the toast notification.<binding template="ToastGeneric">: Defines a generic layout for the toast notification.<text>: Contains the text content of the notification. In this case, there are two<text>elements: “Music Player” and “Download Finished.”<actions>: Defines the action buttons that appear below the notification content.<action>: Specifies an action button. Each<action>element has attributescontent,activationType, andarguments. Thecontentattribute defines the button label,activationTypespecifies the type of action, andargumentsholds the arguments passed when the action is triggered.
- Creating an XML Document: The
$XmlDocumentvariable is created using the Windows Runtime type[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime]::New(). This creates an instance of an XML document that will be used to load the toast notification XML content. - Loading XML Content: The loaded XML content is then assigned to the
$XmlDocumentusing the.loadXml($xml)method. This fills the XML document with the contents of the defined$xmlstring. - App ID: The
$AppIdvariable is set to an identifier that corresponds to PowerShell. This ID is used to associate the toast notification with the PowerShell application. - Displaying the Toast Notification: The last line uses the
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]::CreateToastNotifier($AppId).Show($XmlDocument)method chain to create a toast notifier for the specified app ID and then show the toast notification using the XML content defined in the$XmlDocument.
So, if we go an copy-paste the code into PowerShell ISE and run it, POOF, it works like a charm:
Cool! First I wanted to do some changes like adding an image, make it a bit nicer. Apparently there are some options as stated in the Microsoft documentation so first I tried to add:
<image placement=”appLogoOverride” hint-crop=”circle” src=”C:\Windows\IdentityCRL\WLive48x48.png”/>
Because I am lazy I went to https://www.base64-image.de/ and uploaded my logo and grabbed the base64 encoding:
Then, I have added all the base64 data into a variable and I thought that only by converting from Base64 with PowerShell it will work:
The code that I added is:
$AlkaneBase64String = “YOURBASE64DATA”
$filename = $env:TEMP + “\notification.png”
I also modified the scr in the XML to point to $filename:
<image placement=”appLogoOverride” hint-crop=”circle” src=”$filename”/>
Good, so far so good, all that is left to do is modify the buttons and the text. The text is easy, this is modifiable in the XML.
First I thought that is at easy as setting the argument as a PowerShell command:
- /r – tells the utility that we want to restart
- /f – forces the action
- /t – the amount of time before the action is executed. in our case we set it to 0 because we want the action to be instantaneous
Don’t know why exactly I thought it will work with PowerShell since it was obvious watching the processes that the action will not execute. I started to read again the Microsoft Documentation regarding the action..maybe I missed something. In the description of the arguments it is mentioned:
Digging a bit deeper, it seems that if you do this with C# you can place a name of a certain function that you later on define in your code..but with PowerShell I did not find such a solution.
<action content="Open Folder" activationType="protocol" arguments="file:///C:/Windows/Media" />
URL schemes, also known as URI (Uniform Resource Identifier) schemes or protocol handlers, are a way to launch applications or perform specific actions within applications by clicking on hyperlinks or typing URLs into a web browser’s address bar. While URL schemes are commonly associated with mobile operating systems like iOS and Android, they are also used in Windows to provide similar functionality.
In Windows, URL schemes allow you to interact with specific apps or perform actions by using specially crafted URLs. When you enter a URL with a registered scheme in the browser or another app, Windows understands which app to open or which action to perform based on the scheme.
Key points about URL schemes in Windows:
- Custom Actions:
Developers can register their applications to respond to custom URL schemes. For example, a music player app might register a scheme like “musicplayer://” to open its app when a user clicks on a link with that scheme. - Launching Apps:
URL schemes can be used to launch specific apps directly. For example, typing “mailto:example@example.com” in a browser’s address bar will open the default email client with a new email to “example@example.com.” - Passing Data
URL schemes can pass data to apps as parameters. For instance, a news app might handle URLs like “newsapp://article?id=123” to open a specific news article. - Custom Actions Within Apps:
Apps can also define custom URL schemes to perform actions within the app. For example, a note-taking app might define a scheme like “notes://add?text=Hello” to add a new note with the content “Hello.” - Windows Registry:
To register a URL scheme for an application, developers typically need to modify the Windows Registry. This registration ensures that when a user clicks on a URL with that scheme, Windows knows which app to launch.
As an example:
– `”http://”` and `”https://”` are common URL schemes for web browsing.
– `”mailto:”` launches the default email client.
– `”tel:”` dials a phone number.
– `”ms-settings:”` opens the Windows Settings app.
Windows Registry Editor Version 5.00
Inside the ToastScript.cmd I have only written the shutdown command explained earlier just to see if it works..and guess what..IT WORKS! To define it in the XML is quite easy:
<action content=”Reboot” activationType=”protocol” arguments=”toastprotocol://dosomething” />
The moment I clicked the Reboot button, the virtual machine restarted, I was happy! The next part was to figure out how to parse a PowerShell script inside the ToastScript.cmd, so I figured we should play with the %1. In the Windows Registry, when referring to command registry keys, the `%1` is a placeholder that represents a command-line parameter. It is used to pass data or arguments to an application when it is executed using that command.
When you see `%1` in a command registry key, it indicates that the command is designed to receive additional information, typically from a file or URL, when the associated application is launched. The actual value of `%1` is determined dynamically based on what is being passed to the command.
For example, let’s say you have a registry key associated with a text editor. If you double-click a text file, Windows will use the command specified in the registry to open that file in the text editor. The `%1` placeholder in the command string will be replaced with the path to the specific text file you clicked.
Here’s a simplified example of a command registry key with `%1`:
HKEY_CLASSES_ROOT\textfile\shell\open\command
(Default) = “C:\Path\To\TextEditor.exe” “%1”
When you double-click a text file, Windows will execute the command:
In this case, `%1` gets replaced with the full path to the text file you clicked, allowing the text editor to open that specific file.
So, `%1` is a placeholder that ensures an application can receive and process additional information or files when launched through the Windows shell or other means.
The natural thinking was to place the command in the ToastScript.cmd as such:
powershell.exe -WindowStyle hidden -executionpolicy bypass -NonInteractive -NoLogo -NoProfile -Command “& ‘%1’\
And I think we have found the fault in my logic, the %1 passes all the command along with the protocol name:
But that is ok, we can simply use the Trim and Replace to edit out text since this will be the same always:
powershell.exe -WindowStyle hidden -executionpolicy bypass -NonInteractive -NoLogo -NoProfile -Command “& ‘%1’.Replace(‘toastprotocol://’, ”).Trim(‘/’)”
And voila, it works like a charm! I have created a PowerShell script called test.ps1 placed in C:\ProgramData\toast. The only thing the script does is to open the Downloads folder by using the Invoke-Item cmdlet:

Now all that is left to do is modify the XML:
<action content=”Reboot” activationType=”protocol” arguments=”toastprotocol://C:\ProgramData\toast\test.ps1″ />
So, this is how you put a PowerShell script as an action to a button for a Toast Notification in Windows.
Display a Pop-Up Message with PowerShell
$wshell = New-Object -ComObject Wscript.Shell
$Output = $wshell.Popup("The report generation script is successfully completed!")

Using the various properties of the Popup method, you can customize the appearance of this modal window and add action buttons to it. For example, to display a pop-up prompt with Yes and No buttons, run:

$Output = $wshell.Popup("The script completed successfully. Do you want to view a report?",0,"The report is ready",4+32)
switch ($Output) { 7 {$wshell.Popup('Pressed No')} 6 {$wshell.Popup('Pressed Yes')} default {$wshell.Popup('Invalid input')}
}The general syntax and the available parameters of the Popup method:
- <
Text> — a message text (string); - <
SecondsToWait> —a number (optional). Number of seconds before the message window closes automatically; - <
Title> —string (optional). The title text (caption) of the pop-up window; - <
Type> —number (optional). A combination of flags that determine the type of buttons and icons.
Possible values for the Type flag:
- 0 — only OK button;
- 1 — OK and Cancel;
- 2 — Stop, Retry, and Skip;
- 3 — Yes, No, and Cancel;
- 4 — Yes and No;
- 5 — Retry and Cancel;
- 16 — Stop icon;
- 32 — Question icon;
- 48 — Exclamation icon;
- 64 — Information icon.
- -1 — timeout;
- 1 — OK button;
- 2 — Cancel button;
- 3 — Stop button;
- 4 — Retry button;
- 5 — Skip button;
- 6 — Yes button;
- 7 — No button.
if ([string]::IsNullOrWhiteSpace($input)) { Write-Host " No information provided"
} else { Write-Host " You have entered $input"
}
If you want to display a modal dialogue on top of all windows on the desktop:
How to use BurntToast
Once the module has been installed, you can start using it in PowerShell with the command.
Or more simply using the alias
This will show the default Toast, which is not very useful by itself, but it will serve to check that it works correctly

Now we can customize the Toast with different optional parameters. If you want a list of options and examples you can use
Creating a basic notification
"Hello, this is a sample message."When you run this command, a pop-up notification will appear in the bottom right corner of the screen with the provided message.
Image in the notification
You can add an icon image to the notification using the -AppLogo parameter.
"Message with icon"Adding a sound
BurntToast also allows adding a sound to the notification, as an alarm. You can use one of the default system sounds or provide your own sound file.
To add a default sound, use the -Sound parameter. For example, to use the default Windows notification:
"Message with sound"If you want to provide your own sound file, use the -SoundPath parameter. For example:
"Message with custom sound"These are the simplest examples. You have more on the project’s website, including how to add a button with a link, a “hero” image, or a progress bar, among others.
BurntToast is Open Source, and all the code is available on GitHub – Windows/BurntToast
Showing a Pop-Up Message on Remote Computer Using PowerShell
MSG jsmith /server:Mun-RDS1 "Please restart the SUPGUI client in 5 minutes!”
MSG * /server:Mun-RDS1 " The server will be restarted in 10 minutes. Save your files and open documents!"
To send a pop-up graphical notification to a remote computer, you can use the RemoteSendToasNotification.ps1 script from our GitHub repo ( https://github.com/maxbakhub/winposh/blob/main/WindowsDesktopManagement/RemoteSendToasNotification.ps1). The Invoke-Command cmdlet that is used to establish the connection requires that WinRM be enabled and configured on the remote computer.

How to install BurntToast
If at any time you want to uninstall it, you simply have to execute this command.
Send a Toast Notification from PowerShell Script

To create PowerShell pop-up notifications in Windows, you can use the third-party BurntToast module from the PowerShell gallery. Install the module:
Install-Module -Name BurntToast
For example, now you can easily add a colorful notification to the script from the post “How to automatically disable Wi-Fi when Ethernet cable is connected”:
New-BurntToastNotification -Text " Wi-Fi network disconnection", " Since your device was connected to a high-speed Ethernet LAN, you have been disconnected from your Wi-Fi network" -AppLogo C:\PS\changenetwork.png




