Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
Create notifications using PowerShell for Windows
October 29, 2016
Q. How can I create a balloon notification for Windows in PowerShell?
A. To create a notification in Windows use the following PowerShell as a foundation. Note you can change the type of tip icon to something such as Error and all of the other text.
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon $objNotifyIcon.Icon = "C:WindowsFolder.ico"$objNotifyIcon.BalloonTipIcon = "Warning" $objNotifyIcon.BalloonTipText = "Writing a notification." $objNotifyIcon.BalloonTipTitle = "Test Notification"$objNotifyIcon.Visible = $True $objNotifyIcon.ShowBalloonTip(5000)
Below is the resulting balloon.
You May Also Like