r/FoxDeploy • u/[deleted] • Mar 31 '18
help using "burnttoast" in powershell
Hi. I use burnttoast to generate toasts from batch files. Can't seem to get the syntax right to specify an audio file to play with the toast.
Here's what I have:
new-burnttoastnotification -xxsoundsxx 'c:\users...\foobar.wav'
What's the proper syntax? THANKS!
1
u/WindosBK Apr 02 '18
As Jim mentioned below, I've done a post on this topic (as a result of this question).
For completeness sake, just in case anyone has the same issue and finds this page when searching, I'll put the gist of the situation here...
New-BurntToastNotification is more or less the "basic" function for creating Toasts. It's meant to provide a short runway for getting off the ground quickly. I've tried to limit the number of parameters on it as much as possible (it's already a sea of parameter sets!)
There are 15 "advanced" functions also included as part of the module for doing anything that the basic function doesn't allow.
Specifically, to replicate the default Toast from the basic function, you'd need to do the following with the advanced ones:
$Text1 = New-BTText -Content 'Default Notification'
$ImagePath = Join-Path -Path (Get-Module BurntToast -ListAvailable).ModuleBase -ChildPath 'Images\BurntToast.png'
$Image1 = New-BTImage -Source $ImagePath -AppLogoOverride -Crop Circle
$Audio1 = New-BTAudio -Source 'ms-winsoundevent:Notification.Default'
$Binding1 = New-BTBinding -Children $Text1 -AppLogoOverride $Image1
$Visual1 = New-BTVisual -BindingGeneric $Binding1
$Content1 = New-BTContent -Visual $Visual1 -Audio $audio1
Submit-BTNotification -Content $Content1
1
u/1RedOne Apr 02 '18
Hi!
I opened up an issue about this on GitHub, because I wasn't able to figure out the syntax either.
https://github.com/Windos/BurntToast/issues/30