$title=“title”
$message="hello,world"
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$balloon = New-Object System.Windows.Forms.NotifyIcon
$psProcPath = Get-Process -id $pid | Select-Object -ExpandProperty Path
$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon( $psProcPath )
$balloon.BalloonTipIcon = ‘Info‘
$balloon.BalloonTipText = $message
$balloon.BalloonTipTitle = $title
$balloon.Visible = $true
$balloon.ShowBalloonTip(10000)
sleep -Seconds 3
$balloon.Dispose()
参考:http://www.pstips.net/powershell-show-weather-info.html
原文地址:http://www.cnblogs.com/dreamer-fish/p/3810656.html