Hello
I'm trying to create toast notification with image inline using PowerShell
based on script I found on TechNet gallery I'm executing something like this:
$app = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\PowerShell.exe' [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] $Template = [Windows.UI.Notifications.ToastTemplateType]::ToastImageAndText01 #Gets the Template XML so we can manipulate the values [xml]$ToastTemplate = ([Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent($Template).GetXml()) [xml]$ToastTemplate = @"<toast launch="app-defined-string"><visual><binding template="ToastGeneric"><text>test notification </text><text>Did you know you can use Toast notifications</text><Image src="https://www.windowslatest.com/wp-content/uploads/2018/01/Microsoft-Office-1.jpg" /> </binding></visual></toast>"@ $ToastXml = New-Object -TypeName Windows.Data.Xml.Dom.XmlDocument $ToastXml.LoadXml($ToastTemplate.OuterXml) $notify = [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($app) $notify.Show($ToastXml)
based on this article:
https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/adaptive-interactive-toasts
xml looks ok, unless i'm missing something. I tried different links to images, images are accessible from systems i'm trying this. I tried this on different builds as well.
additional question:, how to use "ms-appdata:///" to point to local file ? The file:/// method was removed unfortunately
kind regards
Piotr