Reputation: 27
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)
Upvotes: 1
Views: 918
Reputation: 180
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
.
Upvotes: 3