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
相关产品推荐
相关产品推荐

