Windows 10 Notification with PowerShell

From WickyWiki
Revision as of 20:19, 25 April 2023 by Wilbert (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This script allows you to show a notification in the Windows 10 Notification area on the bottom left of the screen.

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon

$objNotifyIcon.Icon = [System.Drawing.SystemIcons]::Information
$objNotifyIcon.BalloonTipIcon = "Info" 
$objNotifyIcon.BalloonTipTitle = "Some title" 
$objNotifyIcon.BalloonTipText = "YOUR MESSAGE HERE"
$objNotifyIcon.Visible = $True 
$objNotifyIcon.ShowBalloonTip(10000)
Start-Sleep 500

Source: