Skip to content

Instantly share code, notes, and snippets.

@ChrisColeTech
Last active August 17, 2025 19:48
Show Gist options
  • Select an option

  • Save ChrisColeTech/958197062dff9c11f2c75ffae1178586 to your computer and use it in GitHub Desktop.

Select an option

Save ChrisColeTech/958197062dff9c11f2c75ffae1178586 to your computer and use it in GitHub Desktop.

PowerShell Toast Notification Test Script

Installation:

# Step 1: Add PowerShell to PATH (current session and future sessions)
export PATH="/c/Windows/System32/WindowsPowerShell/v1.0:$PATH"
echo 'export PATH="/c/Windows/System32/WindowsPowerShell/v1.0:$PATH"' >> ~/.bashrc

# Step 2: Reload bash configuration to ensure PATH changes take effect
source ~/.bashrc

# Step 3: Verify PowerShell is now accessible
powershell.exe -Command "Get-Host | Select-Object Version"

# Step 4: Download and run the script
curl.exe -fsSL 'https://gist.githubusercontent.com/ChrisColeTech/1f79919c60bf210982a04bc607a1a1d7/raw/windows_toast_install.ps1' -o windows_toast_install.ps1
powershell.exe -ExecutionPolicy Bypass -File windows_toast_install.ps1

# Step 5: Verify installation succeeded
echo "Exit code: $?"

Key Test Steps:

  1. Uninstall existing toast components
  2. Install fresh toast components
  3. Test toast notification functionality

Requirements:

  • Windows 10/11 with PowerShell
  • Internet connection
  • PowerShell execution permissions

Expected Output:

Colored status messages and a test notification saying "Test Complete - PowerShell toast notification system is working correctly!"

Exit Codes:

  • 0: All tests passed
  • 1: Installation or testing failed

Troubleshooting:

If PowerShell verification fails in Step 3:

# Try alternative PowerShell location (32-bit systems or different installs):
export PATH="/c/Windows/syswow64/WindowsPowerShell/v1.0:$PATH"
echo 'export PATH="/c/Windows/syswow64/WindowsPowerShell/v1.0:$PATH"' >> ~/.bashrc
source ~/.bashrc

Common issues:

  • Module warnings: BurntToast "in use" warnings are normal and don't affect installation
  • Multiple runs: This script can be run multiple times safely (it uninstalls before reinstalling)
  • Notification settings: Check Windows notification settings if no toast appears
  • Internet connection: Ensure connection for module downloads
  • Exit codes: 0 = success, 1 = failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment