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.
BurntToast is a PowerShell module for creating and displaying Windows toast notifications.
It is useful for scripts, reminders, automation alerts, and lightweight desktop notifications.
- 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
Open PowerShell and run:
Install-Module -Name BurntToast -Scope CurrentUserIf prompted to trust the PowerShell Gallery repository, choose:
Y
To update BurntToast later:
Update-Module -Name BurntToast -Scope CurrentUserWindows 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.
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.
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!"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.
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.
To make the notification behave more like a real reminder, use:
-Scenario ReminderAlso include Snooze and Dismiss actions:
$actions = New-BTAction -SnoozeAndDismissA reminder-style BurntToast notification is built using:
New-BTText
New-BTImage
New-BTBinding
New-BTVisual
New-BTAction
New-BTAudio
New-BTContent
Submit-BTNotificationInstead of only using:
New-BurntToastNotificationImport-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"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.
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:
-
Run
encode_image.ps1to embed the images into the script:.\encode_image.ps1
This will create
.\build\Script_Exe_BurntToast.ps1with both images baked in, leaving the source template untouched. -
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.
Program/script:
powershell.exe
Add arguments:
-NoProfile -ExecutionPolicy Bypass -File "<PATH>\Script_BurntToast.ps1"
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
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
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:
https://github.com/Windos/BurntToast
https://github.com/Windos/BurntToast/tree/main/Help
https://www.powershellgallery.com/packages/BurntToast
https://learn.microsoft.com/en-us/windows/apps/develop/notifications/app-notifications/
https://learn.microsoft.com/en-us/windows/apps/develop/notifications/app-notifications-content
- 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.pngandwater-banner.pngcan make the notification look better. ExpirationTimecontrols how long the notification remains in Notification Center, not how long it stays open on screen.- Use
-Scenario Reminderwith Snooze and Dismiss actions for more persistent reminder behavior. - Keep
UseUrgent = $falseunless you specifically want urgent notification behavior.

