Skip to content

Repository files navigation

Hydration Reminder with BurntToast

A small Windows hydration reminder powered by PowerShell, Task Scheduler, and the BurntToast PowerShell module.

This script shows a Windows toast notification reminding me to drink water, then exits quickly so Task Scheduler can run it again later.

What is BurntToast?

BurntToast is a PowerShell module for creating and displaying Windows toast notifications.

It is useful for scripts, reminders, automation alerts, and lightweight desktop notifications.

Requirements

  • Windows 10 or Windows 11
  • PowerShell 5.1 or newer
  • BurntToast PowerShell module
  • Windows notifications enabled
  • Task Scheduler configured to run the script
  • User must be logged in for toast notifications to appear

Install BurntToast

Open PowerShell and run:

Install-Module -Name BurntToast -Scope CurrentUser

If prompted to trust the PowerShell Gallery repository, choose:

Y

To update BurntToast later:

Update-Module -Name BurntToast -Scope CurrentUser

Notification Behavior

Windows notifications do not behave like normal popup windows.

A normal popup can stay open until manually closed, but it also keeps the PowerShell process running.

A normal toast notification behaves like this:

Show briefly -> collapse into Notification Center

That is normal Windows behavior.

What is a BurntToast / Windows Notification Scenario?

A notification scenario tells Windows what kind of notification behavior to use.

For example:

Default scenario  = normal app notification
Reminder scenario = reminder-style notification
Alarm scenario    = alarm-style notification
IncomingCall      = call-style notification

For this hydration reminder, I used

Reminder

The Reminder scenario tells Windows to treat the toast like a reminder instead of a normal temporary message.

Normal Toast vs Reminder Scenario

Normal Toast

A normal toast is simple and works like this:

Show briefly -> collapse into Notification Center

Example:

Import-Module BurntToast

New-BurntToastNotification -Text "Hydration Break", "You should drink water!"

Reminder-Style Toast

A reminder-style toast is more persistent and can include Snooze and Dismiss buttons.

Example concept:

Show reminder -> wait for user action -> Snooze or Dismiss

This is better when I do not want to miss the reminder.


Important Note About ExpirationTime

ExpirationTime does not control how long the notification stays visible on screen.

It controls when the notification is removed from Notification Center.

Example:

ExpirationTime = (Get-Date).AddHours(4)

This means the notification can remain available in Notification Center for up to 4 hours, but Windows may still collapse the popup from the screen earlier.

Sticky Reminder Behavior

To make the notification behave more like a real reminder, use:

-Scenario Reminder

Also include Snooze and Dismiss actions:

$actions = New-BTAction -SnoozeAndDismiss

A reminder-style BurntToast notification is built using:

New-BTText
New-BTImage
New-BTBinding
New-BTVisual
New-BTAction
New-BTAudio
New-BTContent
Submit-BTNotification

Instead of only using:

New-BurntToastNotification

Reminder Scenario Example

Import-Module BurntToast

$text1 = New-BTText -Text "Hydration Break"
$text2 = New-BTText -Text "You should drink water!"
$text3 = New-BTText -Text "Snooze or dismiss this reminder."

$binding = New-BTBinding -Children $text1, $text2, $text3
$visual = New-BTVisual -BindingGeneric $binding

$actions = New-BTAction -SnoozeAndDismiss
$audio = New-BTAudio -Source "ms-winsoundevent:Notification.Reminder"

$content = New-BTContent `
    -Visual $visual `
    -Actions $actions `
    -Audio $audio `
    -Scenario Reminder

Submit-BTNotification `
    -Content $content `
    -UniqueIdentifier "DrinkWaterReminder"

My Hydration Reminder Scripts

Main scripts:

  • Script_BurntToast.ps1 - Uses BurntToast module for notifications.
  • Script_WinForms.ps1 - Uses Windows Forms for a traditional popup.
  • Script_Exe_BurntToast.ps1 - Version for compiling into an executable.

Third Method: Standalone Executable (Compiled with ps2exe)

You can compile the reminder script into a standalone .exe file that bakes the images directly into the script, eliminating the need for external image files.

Workflow:

  1. Run encode_image.ps1 to embed the images into the script:

    .\encode_image.ps1

    This will create .\build\Script_Exe_BurntToast.ps1 with both images baked in, leaving the source template untouched.

  2. Compile the build file with ps2exe:

    Invoke-ps2exe -inputFile ".\build\Script_Exe_BurntToast.ps1" -outputFile ".\build\Script_Exe_BurntToast.exe" -noConsole -STA -noOutput -noError -supportOS

    This generates the final executable which you can run directly or trigger via Task Scheduler.

Recommended Task Scheduler Action

Program/script:

powershell.exe

Add arguments:

-NoProfile -ExecutionPolicy Bypass -File "<PATH>\Script_BurntToast.ps1"

Task Scheduler Action

Recommended Task Scheduler Settings

Use this:

Run only when user is logged on

This is important because toast notifications need an active user desktop session.

Use this:

Repeat task every: 1 hour

Use this:

If the task is already running: Do not start a new instance

This is safe because BurntToast sends the notification and the script exits quickly.

Avoid enabling this unless you only want reminders while charging:

Start the task only if the computer is on AC power

Task Scheduler Settings

Recommended Windows Notification Settings

Make sure Windows notifications are enabled:

Settings -> System -> Notifications

Also check Do Not Disturb / Focus Assist:

Settings -> System -> Notifications -> Do not disturb

If Do Not Disturb is enabled, the reminder may not appear immediately.

On Windows 11, you can also adjust how long notifications stay visible:

Settings -> Accessibility -> Visual effects -> Dismiss notifications after this amount of time

Why Use BurntToast Instead of a Popup?

A normal Windows Forms popup usually uses:

$form.ShowDialog()

That keeps the PowerShell process running until the user closes the window.

For a recurring reminder, this can cause Task Scheduler to skip the next run if the old popup is still open.

BurntToast is better for this use case because it sends the notification and exits quickly.

That means Task Scheduler can run the script again at the next scheduled time.

If you want to review the older Windows Forms popup version, open:

Script_WinForms.ps1

Useful Official Links

BurntToast Main Repository

https://github.com/Windos/BurntToast

BurntToast Documentation Folder

https://github.com/Windos/BurntToast/tree/main/Help

PowerShell Gallery Package

https://www.powershellgallery.com/packages/BurntToast

Microsoft Windows App Notifications Documentation

https://learn.microsoft.com/en-us/windows/apps/develop/notifications/app-notifications/

Microsoft Notification Content Documentation

https://learn.microsoft.com/en-us/windows/apps/develop/notifications/app-notifications-content

Notes

  • Windows notifications must be enabled.
  • Do Not Disturb / Focus Assist may hide or delay notifications.
  • The task should run only when the user is logged in.
  • Optional images such as water-logo.png and water-banner.png can make the notification look better.
  • ExpirationTime controls how long the notification remains in Notification Center, not how long it stays open on screen.
  • Use -Scenario Reminder with Snooze and Dismiss actions for more persistent reminder behavior.
  • Keep UseUrgent = $false unless you specifically want urgent notification behavior.

About

A simple hydration reminder for windows using BurntToast Module for creating and displaying Toast Notifications

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages