This one-liner will create a notification window that will pop up. This could be very useful in a Powershell script.
PS C:\Users\Intel i5> powershell -WindowStyle hidden -Command "& {[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('Critical system error! Contact technical support immediately. Call 1-800-197-123 for prompt technical support.', 'WARNING')}" |
Create a notification bubble that comes out of the System tray.
PS C:\Users\Intel i5> $notify = new-object system.windows.forms.notifyicon PS C:\Users\Intel i5> $notify.icon = [System.Drawing.SystemIcons]::Information PS C:\Users\Intel i5> $notify.visible = $true PS C:\Users\Intel i5> $notify.showballoontip(10,'WARNING','Automatically logoff after 1 hour of inactivity,[system.windows.forms.tooltipicon]::None) PS C:\Users\Intel i5> $notify.showballoontip(10,'WARNING','Critical system error! Contact technical support immediately. Call 1-800-197-123 for prompt technical support.',[system.windows.forms.tooltipicon]::None) |
The screenshot above shows what this looks like, this is very nice. Would be a great way to get a user`s attention when a script reaches a certain point.
To display a notification pop up on a Linux machine, use this one-liner. This is very easy to use.
jason@jason-Lenovo-H50-55:~$ notify-send "Critical system error! Contact technical support immediately. Call 1-800-197-123 for prompt technical support." -i /usr/share/icons/gnome/32x32/emblems/emblem-urgent.png |
Another very useful thing to use in a script is to notify the user when the script has done something. The above example is the best way to do this.