Get toast notifications in windows for gotify
Below is how to recieve toast-notifications for gotify on windows
-
We have to allow powershell scripts run
set-executionpolicy remotesigned
as admin in powershell -
Install BurntToast in powershell. Open powershell as admin then type
Install-Module -Name BurntToast
it will ask some questions just hit yes to all of them -
Download
websocat_win64.exe
from Github HERE -
Below is the script
param ($domain="p.domain.com", $token="AAAAAAAA") C:\Users\user\Downloads\websocat_win64.exe "wss://$domain/stream?token=$token" | %{ convertfrom-json $_ } | where-object {$_.message.length -gt 0} | %{ $appid = $_.appid $icon = iwr https://$domain/application?token=$token -UseBasicParsing | %{ (convertfrom-json $_.content) } | where-object {$_.id -eq $appid} | select -expandproperty image new-burnttoastnotification -applogo https://$domain/$icon -Text $_.title, $_.message }
Now we have a script we can build a exe from it
-
Install ps2exe by running powershell as adimn and typing
Install-Module -Name ps2exe
-
Now create the exe
Invoke-ps2exe .\gotify.ps1 .\gotify.exe
-
Now you can run the EXE is it should work as intended
-
This will create a window poped up. Still working on how to make the script either a
service
or ascheduled task
<- OTHERS ->