From 94625157ca39f5408a31ed78d656ba57520f3f2e Mon Sep 17 00:00:00 2001 From: Paul Wetter Date: Sat, 17 Oct 2020 01:15:25 -0500 Subject: [PATCH 1/4] Added CustomAction and Detection Added functionality for custom actions and detection so you can have the toast display if a script returns a $true It can then build and run a custom protocol. The main goal here is to be able to create flexibility to toast for any custom action. And if desired, build a custom action protocol for that execution. ## Config XML Changes * CustomActions element area. This includes the DetectionScript, Action, and optional ExecutionScript ** If the ExecutionScript is enabled, a new protocol with the Action Name is created. Note that you have to set the Action element to match the named custom action here if you want to use it. ## New Variables * CustomActionsEnabled - Enables/Disables the custom action * CustomDetection - The destection script. * CustomAction - The XML that contains the action name and Script. * CustomActionName - The name of the custom action. ## Functions * Write-FullCustomAction - Writes the action script to the requested directory for the protocol to reference. * Write-FullCustomProtocol - Writes the protocol information into the registry so the action can be called from there. ## New Check * Additional Check for conflicts with custom actions being enabled. ## Misc * Code for determining the results of custom actions, if enabled. * Custom action Toast display section. * modified default toast to not display when custom actions are enabled. --- New-ToastNotification.ps1 | 196 +++++++++++++++++++++++++++------ config-toast-custom.xml | 109 ++++++++++++++++++ config-toast-rebootpending.xml | 14 ++- 3 files changed, 286 insertions(+), 33 deletions(-) create mode 100644 config-toast-custom.xml diff --git a/New-ToastNotification.ps1 b/New-ToastNotification.ps1 index 8b6d593..1ea1cab 100644 --- a/New-ToastNotification.ps1 +++ b/New-ToastNotification.ps1 @@ -82,18 +82,18 @@ ** As well as added support for dynamic deadline retrieval for software updates ** ** Stuff has been rewritten to suit my understanding and thoughts of the script ** - 2.0.0 - Huge changes to how this script handles custom protocols - Added Support for Custom Actions/Protocols within the script under user context removing the need for that to be run under SYSTEM/ADMIN - -