0

I'm developing a desktop app using jetpack compose which uses the windows toast notification feature a lot. I use PowerShell scripts to push the toast notification using BurntToast module. The notification works fine but, every time it gets executed, I see Windows Powershell as the app name and not any custom name.

PowerShell Notification Image:

PowerShell Notification Image

How do I change the name from Windows PowerShell to my desired name?

# First, create all the component pieces

$AppLogo = New-BTImage -Source 'C:\Demos\img.jpg' -AppLogoOverride -Crop Circle
$HeroImage = New-BTImage -Source 'https://c.tenor.com/XfrqyR_-jzIAAAAC/anime-goku.gif' -HeroImage
$MapImage = New-BTImage -Source 'https://media.giphy.com/media/WW33vGSPHXym7Wh80e/giphy.gif'

$TextHeading = New-BTText -Text 'Lord Shiva'
$TextBody = New-BTText -Text 'The mightiest god there is!'

# Then bind them together

$Binding = New-BTBinding -Children $TextHeading, $TextBody, $MapImage -AppLogoOverride $AppLogo -HeroImage $HeroImage

# And remember that these components are visual, but not actionable

$Visual = New-BTVisual -BindingGeneric $Binding

# Speaking of actionable, we're using actions right?

$GoogleButton = New-BTButton -Content 'Google Maps' -Arguments 'https://www.google.com/maps/SNIP'
$BingButton = New-BTButton -Content 'Bing Maps' -Arguments 'https://www.bing.com/maps?SNIP'

# Don't forget that an action by itself is useless, even a single button needs to become plural

$Actions = New-BTAction -Buttons $GoogleButton, $BingButton

# Now all of the content is together...

$Content = New-BTContent -Visual $Visual -Actions $Actions

# We can submit it to the Operating System

Submit-BTNotification -Content $Content
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Ash
  • 1
  • 3
  • 2
    Did you try `-AppId` parameter of `Submit-BTNotification`? – zett42 Feb 23 '22 at 11:00
  • I did dig into it, but I have no idea how to execute it. Everytime I try using -AppId -- it throws a "Exception calling "CreateToastNotifier" error. So, can you help me out here?? – Ash Feb 23 '22 at 11:47
  • 1
    Can you give more details about the exception? Please edit your post and show what you have tried with `-AppId` and what the exact exception message is. – zett42 Feb 23 '22 at 15:26

0 Answers0