I have this powershell script to send a notification which works great, except for the fact that it is not saved in the notification center. It times out, and fades away, but it is not there when you click the notifications button on the right of the taskbar. Is there anything I could add to my script to make it happen? Thanks!
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon
$objNotifyIcon.Icon = "icoOnline.ico"
$objNotifyIcon.BalloonTipIcon = "None"
$objNotifyIcon.BalloonTipText = "wzzup this is a title."
$objNotifyIcon.BalloonTipTitle = "WHATS UPPP THIS IS A PARAGRAPH!"
$objNotifyIcon.Visible = $True
$objNotifyIcon.ShowBalloonTip(10000)
You can use a while condition to make it last. But again dont make the script hold permanently. Instead you can create a background job for the same.
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon
while($True)
{
$objNotifyIcon.Icon = [System.Drawing.SystemIcons]::Information
$objNotifyIcon.BalloonTipIcon = "Info"
$objNotifyIcon.BalloonTipTitle = "wzzup this is a title."
$objNotifyIcon.BalloonTipText = "WHATS UPPP THIS IS A PARAGRAPH!"
$objNotifyIcon.Visible = $True
$objNotifyIcon.ShowBalloonTip(10000)
Start-Sleep 500
}
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With