首页 > 代码库 > 右下角显示提示窗口

右下角显示提示窗口

$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