Images for toast notifications not rendering

John 21 Reputation points
2022-08-14T02:11:29.817+00:00

I can't see the image in powershell, but I can see it in the terminal. What is the difference between these?

   $ToastImageAndText01 = [Windows.UI.Notifications.ToastTemplateType, Windows.UI.Notifications, ContentType = WindowsRuntime]::ToastImageAndText01  
   $TemplateContent = [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]::GetTemplateContent($ToastImageAndText01)  
   $TemplateContent.SelectSingleNode('//image[@id="1"]').SetAttribute('src', 'https://unsplash.it/64?image=669')  
   $TemplateContent.SelectSingleNode('//text[@id="1"]').InnerText = 'Hello world'  
   Get-StartApps | % { [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($_.AppID).Show($TemplateContent) }  

230985-image.png231061-image.png

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,357 questions
{count} votes