操作中心未显示 Windows Toast 通知 [英] Windows Toast Notification not showing in Action Center
本文介绍了操作中心未显示 Windows Toast 通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
需要一些帮助.我让这个脚本在 Win 10 中的 toast 通知的 power shell 中工作,但通知不会显示在操作中心.任何帮助将不胜感激.
Need some help. I got this script working in power shell for toast notifications in Win 10 but the notification just wouldn't show in Action Center. Any help would be appreciated.
param(
[String] $Title
)
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
[Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
$template = @"
<toast duration = "long">
<visual>
<binding template="ToastGeneric">
<text id="1">Hello World</text>
<text id="2">How are you Today?</text>
<text id="3">Can we Script something Great today?</text>
</binding>
</visual>
<audio src="ms-winsoundevent:Notification.Reminder"/>
</toast>
"@
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
$xml.LoadXml($template)
$toast = New-Object Windows.UI.Notifications.ToastNotification $xml
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Visa Client Engineering").Show($toast)
推荐答案
您必须创建一个注册表项.
You'll have to create a registry key.
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Visa Client Engineering
创建一个名为 ShowInActionCenter
且值为 1
的 DWORD.
Create a DWORD named ShowInActionCenter
with value 1
.
这篇关于操作中心未显示 Windows Toast 通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文