This test script provides automated testing for the Windows Toast Notification system in WSL environments. It performs a complete uninstall and reinstall cycle to verify that all components are working correctly.
The test script (test_toast_install.sh) automates the complete lifecycle testing of toast notifications by:
- Uninstalling existing components - Removes both WSL and Windows toast components
- Reinstalling fresh components - Downloads and installs the latest versions
- Testing functionality - Verifies that toast notifications work end-to-end
Download and run the test script:
# Step 1: Verify PowerShell is accessible (use full path)
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command "Get-Host | Select-Object Version"
# Step 2: Download and run the test script
curl -fsSL 'https://gist.githubusercontent.com/ChrisColeTech/fa65773ebbdd4956678327841a895669/raw/test_toast_install.sh' -o test_toast_install.sh
chmod +x test_toast_install.sh
./test_toast_install.shNote for WSL users: The test script automatically detects WSL environment and uses the correct PowerShell path (/mnt/c/). No PATH modification needed.
# Step 1: Add PowerShell to PATH (MSYS2/Git Bash users)
export PATH="/c/Windows/System32/WindowsPowerShell/v1.0:$PATH"
echo 'export PATH="/c/Windows/System32/WindowsPowerShell/v1.0:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Step 2: Verify PowerShell is accessible
powershell.exe -Command "Get-Host | Select-Object Version"
# Step 3: Download and run the test script
curl -fsSL 'https://gist.githubusercontent.com/ChrisColeTech/fa65773ebbdd4956678327841a895669/raw/test_toast_install.sh' -o test_toast_install.sh
chmod +x test_toast_install.sh
./test_toast_install.sh- Downloads the WSL uninstaller script
- Removes toast function from shell configuration files (
.bashrc,.zshrc) - Removes the
~/bin/toastexecutable script - Cleans up PATH modifications
- Downloads the Windows uninstaller script
- Removes PowerShell scripts (
toast.ps1,toast.cmd) - Removes the
~/bindirectory from Windows PATH - Uninstalls the BurntToast PowerShell module (with
-Forceflag) - Cleans up Windows user profile modifications
- Downloads the latest WSL installer script
- Automatically detects Windows username
- Installs Windows components:
- NuGet package provider
- BurntToast PowerShell module
- PowerShell and CMD wrapper scripts
- Installs WSL components:
- Shell functions for bash and zsh
- Executable script in
~/bin/toast - PATH modifications
- Sources shell configuration to load new functions
- Sends a test notification: "Test Complete - Toast notification system is working correctly!"
- Verifies that the toast command is available and functional
The test script provides colored output with clear status messages:
=== Toast Notification Test Script ===
[INFO] Step 1: Uninstalling WSL toast components...
[INFO] Step 2: Uninstalling Windows toast components...
[INFO] Step 3: Installing toast notifications (both Windows and WSL)...
[INFO] Step 4: Testing toast notification functionality...
[INFO] ✓ Toast notification test successful!
=== Test Script Complete ===
[INFO] Toast notification system has been successfully uninstalled and reinstalled.
[INFO] You should have seen a test notification appear.
- Windows 10/11 with WSL enabled
- Internet connection for downloading scripts and PowerShell modules
- PowerShell execution permissions (handled automatically by the script)
- Basic shell access (bash or zsh)
- Ensure you have write permissions to your home directory
- Check that you can access Windows file system from WSL (
/mnt/c/)
- Verify internet connectivity for downloading scripts
- Ensure PowerShell is available at
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe - Check that you can write to Windows Downloads folder
If you get "powershell.exe: command not found":
For WSL users:
# Try alternative PowerShell location (32-bit systems):
export PATH="/mnt/c/Windows/syswow64/WindowsPowerShell/v1.0:$PATH"
echo 'export PATH="/mnt/c/Windows/syswow64/WindowsPowerShell/v1.0:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Or try using full path directly:
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command "Get-Host | Select-Object Version"For MSYS2/Git Bash users:
# Try alternative PowerShell location (32-bit systems):
export PATH="/c/Windows/syswow64/WindowsPowerShell/v1.0:$PATH"
echo 'export PATH="/c/Windows/syswow64/WindowsPowerShell/v1.0:$PATH"' >> ~/.bashrc
source ~/.bashrc- Try opening a new terminal session and running
toast "test" "message"manually - Verify that
~/binis in your PATH:echo $PATH | grep bin - Check that the toast function is loaded:
type toast
- Check Windows notification settings (Settings > System > Notifications)
- Ensure Focus Assist is not blocking notifications
- Try running the toast command manually:
toast "Manual Test" "Hello World"
This test script works with the following components:
- WSL Installer:
https://gist.github.com/ChrisColeTech/010a3a1f313fa39a10566a328c32424b - Windows Installer:
https://gist.github.com/ChrisColeTech/1f79919c60bf210982a04bc607a1a1d7 - WSL Uninstaller:
https://gist.github.com/ChrisColeTech/42d5862c4817c269ef6aa42f7ff490ce - Windows Uninstaller:
https://gist.github.com/ChrisColeTech/c7c8d4fb8f8e72ac01722cb5d5ce79f9
0: All tests passed successfully1: Failed to download required scripts1: Installation or testing failed
- The script downloads and executes PowerShell scripts from trusted gist sources
- All temporary files are cleaned up after execution
- The script uses
-ExecutionPolicy Bypassonly for the specific toast installation scripts - No permanent system modifications are made beyond the toast notification functionality
If you encounter issues with the test script, ensure that:
- The individual installation scripts work when run manually
- Your WSL environment has proper access to the Windows file system
- Windows PowerShell execution is not blocked by group policy
- You have sufficient permissions to install PowerShell modules
For detailed troubleshooting, run the individual installer scripts manually to isolate any specific issues.