You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 11下PowerShell Toast Notification的BalloonTipIcon无法显示

Windows 11下PowerShell Toast通知图标无法显示

尝试通过PowerShell在Windows 11上显示Toast通知,通知能正常弹出,但BalloonTipIcon始终无法显示。

完整测试代码

Add-Type -AssemblyName System.Windows.Forms 
$global:balloon = New-Object System.Windows.Forms.NotifyIcon
$path = (Get-Process -id $pid).Path
$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) 
$balloon.BalloonTipIcon =  [System.Windows.Forms.ToolTipIcon]::Info 
$balloon.BalloonTipText = 'Su informe se ha generado.'
$balloon.BalloonTipTitle = "Hola, $Env:USERNAME" 
$balloon.Visible = $true 
$balloon.ShowBalloonTip(5000)

已尝试的两种图标设置方式

  • 方式一:
$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Info 
  • 方式二:
$balloon.BalloonTipIcon = "Info"

实际显示效果

实际通知效果

内容的提问来源于stack exchange,提问作者1x2x3x4x

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 13:09:58