Ever want to display a balloon tip notification for something in PowerShell? No? Well, it’s cool. Maybe you should try it out!
[reflection.assembly]::loadwithpartialname("System.Windows.Forms")
[reflection.assembly]::loadwithpartialname("System.Drawing")
$icon = new-object system.drawing.icon("c:\myscriptsicon.ico")
$notify = new-object system.windows.forms.notifyicon
$notify.icon = $icon
$notify.visible = $true
$notify.showballoontip(10,"Title","Message", `
[system.windows.forms.tooltipicon]::warning)
On that last line, the 10 is the number of seconds to display the tip. The Warning icon could also be Error or None, depending on your need. Finally, note that you do need to load a valid .ICO icon file – I used a sample icon file I had, but you’ll need to obtain a legit .ICO file to make the third line work.
Set $notify.visible = $false to get rid of the icon; if you just close the shell, the icon will stay visible until you try to move your mouse over it – then Windows will “realize” it’s gone and remove it.
If I check your RSS feed, it seems to stop with the previous WMI post, and does not have this post nor the x64 one. I don’t know if the RSS feed is automatic or generated on a scheduled basis.
Possibly a good icon to use for anyone with the PowerShell Community Extensions 1.1 installed:
"C:\Program Files\PowerShell Community Extensions\PowerShellCX.ico"
PSCX: http://www.codeplex.com/powershellcx