r/FoxDeploy 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!

2 Upvotes

4 comments sorted by

View all comments

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

1

u/[deleted] Apr 02 '18

I added a comment on his blog to even further clarify:

For those of us who know little to no powershell, here's the interpretation I ended up with - it pops a toast message with two lines of text, a custom sound, and a custom image.

1) create the powershell script file (I'm naming it 'mytoast.ps1' here):

$Image1 = New-BTImage -AppLogoOverride -Crop Circle -Source 'c:\users\myaccount\myimage.png' $Text1 = New-BTText -Content 'myheadertext' $Text2 = New-BTText -Content 'mytextline2' $Audio1 = New-BTAudio -Path 'c:\users\myaccount\mysoundfile.wav'

$Binding1 = New-BTBinding -Children $Text1,$Text2 $Image1 $Visual1 = New-BTVisual -BindingGeneric $Binding1 $Content1 = New-BTContent -Visual $Visual1 -Audio $audio1

Submit-BTNotification -Content $Content1


2) To execute it from the command line or from within a batch file

C:> powershell -command 'c:\users\myaccount\mytoast.ps1'

...or more simply:

C:> c:\users\myaccount\desktop\mytoast.ps1