Tool-highlight: Show Windows Toast Messages with PowerShell

Happy New Years, everyone!

This will be a quick post here, but I just wanted to shine a spotlight on an AWESOME tool that I absolutely love: Joshua King’s ‘BurntToast’ PowerShell module, which makes the arduous task of rendering a Windows Toast notification VERY Easy.

Check out his GitHub repo here, and view the module’s page on the PowerShell gallery here.

Here’s an example of what I’m talking about


Why might I want to use this?

Any time you want to provide data to the end-user, but not require them to drop everything to interact. I don’t know about you, but I really dislike alert dialog boxes.  Especially if they lock my whole desktop until I quickly ignore it and click the ‘X’ button…err, read it.

I also believe that toasts are what users expect, especially to receive updates from long-running scripts.  They really do provide a polished, refined look to your scripts.

Finally, you can also provide your own image and play your own sound effects too!

Real-time encryption notices

At a current customer, we’re deploying a device management profile using MDM to use BitLocker encryption on these devices.  We decided that it would be very useful to be able to see updates as a device was encrypting, so I wrote up this script around the BurntToast tool.

install-module BurntToast -Force
Import-module BurntToast

$EncryptionStatus = Get-BitLockerVolume -MountPoint c:

    While ($EncryptionStatus.VolumeStatus -eq 'EncryptionInProgress'){

        if (($EncryptionStatus.EncryptionPercentage % 5)-eq 0){
            New-BurntToastNotification -Text 'Encryption Progress', "Now $($EncryptionStatus.EncryptionPercentage)% completed."

        Start-Sleep -Seconds 30

        $EncryptionStatus = Get-BitLockerVolume -MountPoint c:
        Write-host $EncryptionStatus.EncryptionPercentage

New-BurntToastNotification -Text 'Encryption Completed' 'Now completed.' -Image "C:\Users\sred1\Dropbox\Docs\blog\foxderp - Copy.png"

And a screen shot of it in action!


8 thoughts on “Tool-highlight: Show Windows Toast Messages with PowerShell

  1. Gurumurthy Gunasekaran January 9, 2017 / 5:53 am

    Hi Stephen,
    Is is possible to have this for a chat application we’re using the XMPP protocol and the spark as a client software. I’d likes to try because while working in a remote system i don’t receive the notification in that software so that this might be a helpful one…


    • FoxDeploy January 12, 2017 / 9:10 am

      Anything is possible. How do you plan on your desktop knowing there’s a new message on the remote machine?


      • Gurumurthy Gunasekaran January 13, 2017 / 12:37 am

        I’m planing to show the message that should be shown anywhere else i’m working in that system. Have you seen that notifications from that Gtalk it will shown you on the right below corner… That notifications will not shown while your’re in the remote system with full screen… But the windows default toast notifications will shown anywhere you’re using even that is full screen in remote… So i have to setup that software to receive the notification and show it as windows notifiication… And BTW I’m not a developer, i have seen your article in the right time when i got this idea… I’ll try and tell you on this post if i succeeded…


      • Gurumurthy Gunasekaran January 25, 2017 / 2:33 am

        Hi Stephen,
        Here’s my code can you please check it where did I did wrong and help me to optimize it. I’m a newbie to the powershell scripting.

        Import-Module BurntToast
        $Ping = Test-Connection -ComputerName “”
        if ($Ping.Quiet -eq $true){
        New-BurntToastNotification -FirstLine “Connection is Active” -SecondLine “Connection is still Active”
        elseif($ping.Quiet -eq $false)
        New-BurntToastNotification -FirstLine “Server is not active” -SecondLine “Check immediately for the Reason”
        New-BurntToastNotification -FirstLine “System Not Found” -SecondLine “Check immediately for the Reason”

        I have found it in debugging that this was stopping here ” if ($Ping.Quiet -eq $true) ”


        Liked by 1 person

  2. Steve January 19, 2017 / 4:53 pm

    This seems very handy the problem is that message disappears very quickly and doesn’t Save in the history. The length of display needs to be longer and there needs to be an OK button to dismiss if desired.


  3. Brad Suggs (@bsuggsx) December 21, 2017 / 7:57 am

    Thanks for this code. I’m using the while loop to do a Write-Progress instead of a notification. We place the powershell script at the end of the MDT task sequence and the MDT progress bar displays the Bitlocker encryption progress and holds the build until the full disk encryption completes.


Have a code issue? Share your code by going to and pasting your code there, then post the link here!

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.