Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a Custom Action and Detection Functionality #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

paulwetter
Copy link

Added functionality for custom actions and detection so you can have the toast display if a detection script returns a $true. It can then build and run a custom protocol (or run an existing 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.
  • Added xml example file config-toast-custom.xml that checks if the System32 directory exists and if so, creates a new protocol to display a custom Toast. (note: XML within the XML does require escaping so it can get messy.

paulwetter and others added 3 commits October 17, 2020 01:15
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.
Copy link
Owner

@imabdk imabdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Paul. Great minds thinks alike it seems. I was actually in the process of creating the second action button myself, so you just made that a tad easier. Appreciate the work. I believe you have sent me something previously as well (your name rings a bell). I'm going to merge this into a new release, but I'll do it outside of Git. Thanks again :-)

@imabdk imabdk closed this Nov 15, 2020
@imabdk imabdk reopened this Nov 15, 2020
@paulwetter
Copy link
Author

Yah, I commented in your 1.6 post this spring as I got it ready for my windows servicing this last summer. Some of the same stuff was in that comment (second action) as is in this pull. Now that you have it on GitHub, was much easier to contribute. :-) Been using this updated version for soliciting other updates ahead of time as well. And with the ability of dynamic protocols, I was in heaven! Now I can create a custom protocol for whatever I need. I still have to work on my own blog post for how I used this for servicing to 1909. Very good response from end users.

Thank you for sharing this great tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants