2016-05-30 38 views
2

ヘルプが必要です。 Win 10でトースト通知用のパワーシェルでこのスクリプトを動作させましたが、通知はAction Centerに表示されません。どんな助けもありがとう。Windows Toast通知がアクションセンターに表示されない

 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) 

答えて

3

レジストリキーを作成する必要があります。

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

1ShowInActionCenterという名前のDWORDを作成します。

関連する問題