This commit is contained in:
Ben Whitmore 2020-12-30 14:24:04 +00:00
commit f7fa13de2e
3 changed files with 71 additions and 4 deletions

View file

@ -2,8 +2,8 @@
<ToastContent> <ToastContent>
<ToastTitle>We want to bring to your attention some important information. Please review the details below before contacting the Service Desk</ToastTitle> <ToastTitle>We want to bring to your attention some important information. Please review the details below before contacting the Service Desk</ToastTitle>
<Signature>Sent on behalf of the ICT Service Desk</Signature> <Signature>Sent on behalf of the ICT Service Desk</Signature>
<EventTitle>Major IT Issues</EventTitle> <EventTitle>Major IT Issues - Flooding</EventTitle>
<EventText>We are currently experiencing problems with all our systems. We are drinking coffee will provide an update shortly. Thank you for your patience</EventText> <EventText>We are currently experiencing problems with all our systems. We are drinking coffee with our feet up and will provide an update shortly. Thank you for your patience</EventText>
<ButtonTitle>Details</ButtonTitle> <ButtonTitle>Details</ButtonTitle>
<ButtonAction>https://byteben.com</ButtonAction> <ButtonAction>https://byteben.com</ButtonAction>
<SnoozeTitle>Snooze</SnoozeTitle> <SnoozeTitle>Snooze</SnoozeTitle>

View file

@ -1,2 +1,69 @@
# Toast # Toast
**Screenshots**
http://byteben.com/bb/wp-content/uploads/2020/07/Toast-Example.jpg
http://byteben.com/bb/wp-content/uploads/2020/07/Content-Example.jpg
**Description**
The "Toast Notify" solution will pop a notification toast from the system tray in Windows 10 (See Toast-Example.jpg). This project was born out of the desire for me to understand Toast Notifications better and seek to replace a 3rd party desktop notification solution. The titles, texts and action button are customisable via an XML document.
Toast_Notify.ps1 is a script designed to be deployed as a package from MEMCM. The "Set and forget" mentality of packages works really well because we don't need to specify a detection method once the script has run.
Toast_Notify.ps1 will read an XML file on a file share or from the same directory. If the XML is stored on a fileserver, the Toast Notifications can be changed "on the fly" without having to repackage the script.
To create a custom XML, copy CustomMessage.xml and edit the text you want to display in the toast notification. Place the modified XML in the script directory or on a fileserver. Call your custom file using one of the script parameters below.
**Points to Consider**
I am using an existing app in Windows to call the Toasts. This script creates two buttons in the Toast, "Details" and "Dismiss". Cicking details is designed to take the user to an internal Service Desk announcement page. For that reason, **MSEdge** works really well because the Toast Action launches the browser in the foreground. Oh, you will need MSEdge installed on your client computers for this to work.
The following files should be present in the Script Directory when you create the package in MEMCM:-
**Toast_Notify.ps1
BadgeImage.jpg
HeroImage.jpg (364 x 180px, 3MB Normal Connection / 1MB Metered Connection)
CustomMessage.xml**
More information and Toast Content guidelines can be found at:-
https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/toast-ux-guidance
**Parameters**
You should specify either XMLScriptSourceDir **or** XMLOtherSource parameters but not both. If you specify no parameter the script will read the CustomMessage.xml in the script root.
**.PARAMETER XMLScriptDirSource**
Specify the name of the XML file to read. The XML file must exist in the same directory as Toast_Notify.ps1. If no parameter is passed, it is assumed the XML file is called CustomMessage.xml.
**.PARAMETER XMLOtherSource**
Specify the location of the Custom XML file used for the Toast when it is not the same directory as Toast_Notify.ps1 e.g the full UNC path to the XML file.
**.EXAMPLE**
Toast_Notify.ps1 -XMLOtherSource "\\\\fileserverhome\xml\CustomMessage.xml"
**.EXAMPLE**
Toast_Notify.ps1 -XMLSciptDirSource "PhoneSystemProblems.xml"
**.EXAMPLE**
Toast_Notify.ps1
**Known Issues**
Currently, the images in the XML can only be read from the local file system. This is not an issue if we are deploying the package from MEMCM.
**Thanks for the help from**
@guyrleech
@young_robbo
**Community**
Seriously check our Martin Bentsson's work on Toasts. It is very comprehensive. https://www.imab.dk/windows-10-toast-notification-script/
I don't believe in reinventing the wheel, part of me was saying "Use Martin's Script", but I challenged myself to learn how Windows Toasts work from the ground up - so this project was a labour of love for me. I have enjoyed the ride so far.
If you have any comments, feedback or would like to contribute - please don't be shy!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before After
Before After