Windows Toast Notification not showing in Action Center

╄→гoц情女王★ 提交于 2020-01-15 06:38:51

问题


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)

回答1:


You'll have to create a registry key.

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Visa Client Engineering

Create a DWORD named ShowInActionCenter with value 1.



来源:https://stackoverflow.com/questions/37518286/windows-toast-notification-not-showing-in-action-center

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!