Skip to content

Custom Protocol Support For Notification itself #37

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions New-ToastNotification-AppLocker-Edition.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
- <Option Name="Action" Value="ToastRunUpdateID:" />
- <Option Name="Action" Value="ToastRunPackageID:" />
- <Option Name="Action" Value="ToastRunApplicationID:" />
- <Option Name="Action" Value="ToastReboot:" />
Added Support to dynamically create Custom Action Scripts to support Custom Protocols
Added Support for Software (Feature) Updates : Searches for an update and will store in variable
Added new XML Types for Software Updates:
- <Option Name="RunUpdateID" Enabled="True" Value="3012973" />
- <Option Name="RunUpdateTitle" Enabled="True" Value="Version 1909" />
Added support for getting deadline date/time dynamically for software updates
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
- <Option Name="Action" Value="ToastRunUpdateID:" />
- <Option Name="Action" Value="ToastRunPackageID:" />
- <Option Name="Action" Value="ToastRunApplicationID:" />
- <Option Name="Action" Value="ToastReboot:" />
Added Support to dynamically create Custom Action Scripts to support Custom Protocols
Added Support for Software (Feature) Updates : Searches for an update and will store in variable
Added new XML Types for Software Updates:
- <Option Name="RunUpdateID" Enabled="True" Value="3012973" />
- <Option Name="RunUpdateTitle" Enabled="True" Value="Version 1909" />
Added support for getting deadline date/time dynamically for software updates
- Configure DynamicDeadline with the UpdateID

2.0.1 - Updated custom action scripts!
Expand All @@ -106,7 +106,7 @@
- If newer version is available from the script, new custom action scripts will be created
- This allows me to make sure the relevant scripts are in place in case I change something along the way
- Modified script output of custom script for RunPackageID to pick up Program ID dynamically
Added support for getting deadline date/time dynamically for applications
Added support for getting deadline date/time dynamically for applications
- Configure DynamicDeadline with the Application ID

2.0.2 - Fixed an error in the custom protocols
Expand Down Expand Up @@ -1708,6 +1708,7 @@ if(-NOT[string]::IsNullOrEmpty($Xml)) {
$Scenario = $Xml.Configuration.Option | Where-Object {$_.Name -like 'Scenario'} | Select-Object -ExpandProperty 'Type'
$Action1 = $Xml.Configuration.Option | Where-Object {$_.Name -like 'Action1'} | Select-Object -ExpandProperty 'Value'
$Action2 = $Xml.Configuration.Option | Where-Object {$_.Name -like 'Action2'} | Select-Object -ExpandProperty 'Value'
$LaunchProtocol = $Xml.Configuration.Option | Where-Object {$_.Name -like 'LaunchProtocol'} | Select-Object -ExpandProperty 'Value'
$GreetGivenName = $Xml.Configuration.Text | Where-Object {$_.Option -like 'GreetGivenName'} | Select-Object -ExpandProperty 'Enabled'
$MultiLanguageSupport = $Xml.Configuration.Text | Where-Object {$_.Option -like 'MultiLanguageSupport'} | Select-Object -ExpandProperty 'Enabled'
# Load Toast Notification buttons
Expand Down Expand Up @@ -2268,7 +2269,7 @@ if ($GreetGivenName -eq "True") {
if (($ActionButton1Enabled -eq "True") -AND ($DismissButtonEnabled -eq "True")) {
Write-Log -Message "Creating the xml for action button and dismiss button"
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2304,7 +2305,7 @@ if (($ActionButton1Enabled -eq "True") -AND ($DismissButtonEnabled -eq "True"))
if (($ActionButton1Enabled -ne "True") -AND ($DismissButtonEnabled -ne "True")) {
Write-Log -Message "Creating the xml for no action button and no dismiss button"
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2338,7 +2339,7 @@ if (($ActionButton1Enabled -ne "True") -AND ($DismissButtonEnabled -ne "True"))
if (($ActionButton1Enabled -eq "True") -AND ($DismissButtonEnabled -ne "True")) {
Write-Log -Message "Creating the xml for no dismiss button"
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2373,7 +2374,7 @@ if (($ActionButton1Enabled -eq "True") -AND ($DismissButtonEnabled -ne "True"))
if (($ActionButton1Enabled -ne "True") -AND ($DismissButtonEnabled -eq "True")) {
Write-Log -Message "Creating the xml for no action button"
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2410,7 +2411,7 @@ if ($ActionButton2Enabled -eq "True") {
Write-Log -Message "This will always enable both action buttons and the dismiss button" -Level Warn
Write-Log -Message "Replacing any previous formatting of the toast xml" -Level Warn
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2449,7 +2450,7 @@ if ($SnoozeButtonEnabled -eq "True") {
Write-Log -Message "This will always enable the action button as well as the dismiss button" -Level Warn
Write-Log -Message "Replacing any previous formatting of the toast xml" -Level Warn
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down
39 changes: 20 additions & 19 deletions New-ToastNotification.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
- <Option Name="Action" Value="ToastRunUpdateID:" />
- <Option Name="Action" Value="ToastRunPackageID:" />
- <Option Name="Action" Value="ToastRunApplicationID:" />
- <Option Name="Action" Value="ToastReboot:" />
Added Support to dynamically create Custom Action Scripts to support Custom Protocols
Added Support for Software (Feature) Updates : Searches for an update and will store in variable
Added new XML Types for Software Updates:
- <Option Name="RunUpdateID" Enabled="True" Value="3012973" />
- <Option Name="RunUpdateTitle" Enabled="True" Value="Version 1909" />
Added support for getting deadline date/time dynamically for software updates
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
- <Option Name="Action" Value="ToastRunUpdateID:" />
- <Option Name="Action" Value="ToastRunPackageID:" />
- <Option Name="Action" Value="ToastRunApplicationID:" />
- <Option Name="Action" Value="ToastReboot:" />
Added Support to dynamically create Custom Action Scripts to support Custom Protocols
Added Support for Software (Feature) Updates : Searches for an update and will store in variable
Added new XML Types for Software Updates:
- <Option Name="RunUpdateID" Enabled="True" Value="3012973" />
- <Option Name="RunUpdateTitle" Enabled="True" Value="Version 1909" />
Added support for getting deadline date/time dynamically for software updates
- Configure DynamicDeadline with the UpdateID

2.0.1 - Updated custom action scripts!
Expand All @@ -106,7 +106,7 @@
- If newer version is available from the script, new custom action scripts will be created
- This allows me to make sure the relevant scripts are in place in case I change something along the way
- Modified script output of custom script for RunPackageID to pick up Program ID dynamically
Added support for getting deadline date/time dynamically for applications
Added support for getting deadline date/time dynamically for applications
- Configure DynamicDeadline with the Application ID

2.0.2 - Fixed an error in the custom protocols
Expand Down Expand Up @@ -1688,6 +1688,7 @@ if(-NOT[string]::IsNullOrEmpty($Xml)) {
$Scenario = $Xml.Configuration.Option | Where-Object {$_.Name -like 'Scenario'} | Select-Object -ExpandProperty 'Type'
$Action1 = $Xml.Configuration.Option | Where-Object {$_.Name -like 'Action1'} | Select-Object -ExpandProperty 'Value'
$Action2 = $Xml.Configuration.Option | Where-Object {$_.Name -like 'Action2'} | Select-Object -ExpandProperty 'Value'
$LaunchProtocol = $Xml.Configuration.Option | Where-Object {$_.Name -like 'LaunchProtocol'} | Select-Object -ExpandProperty 'Value'
$GreetGivenName = $Xml.Configuration.Text | Where-Object {$_.Option -like 'GreetGivenName'} | Select-Object -ExpandProperty 'Enabled'
$MultiLanguageSupport = $Xml.Configuration.Text | Where-Object {$_.Option -like 'MultiLanguageSupport'} | Select-Object -ExpandProperty 'Enabled'
# Load Toast Notification buttons
Expand Down Expand Up @@ -2211,7 +2212,7 @@ if ($GreetGivenName -eq "True") {
if (($ActionButton1Enabled -eq "True") -AND ($DismissButtonEnabled -eq "True")) {
Write-Log -Message "Creating the xml for action button and dismiss button"
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2247,7 +2248,7 @@ if (($ActionButton1Enabled -eq "True") -AND ($DismissButtonEnabled -eq "True"))
if (($ActionButton1Enabled -ne "True") -AND ($DismissButtonEnabled -ne "True")) {
Write-Log -Message "Creating the xml for no action button and no dismiss button"
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2281,7 +2282,7 @@ if (($ActionButton1Enabled -ne "True") -AND ($DismissButtonEnabled -ne "True"))
if (($ActionButton1Enabled -eq "True") -AND ($DismissButtonEnabled -ne "True")) {
Write-Log -Message "Creating the xml for no dismiss button"
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2316,7 +2317,7 @@ if (($ActionButton1Enabled -eq "True") -AND ($DismissButtonEnabled -ne "True"))
if (($ActionButton1Enabled -ne "True") -AND ($DismissButtonEnabled -eq "True")) {
Write-Log -Message "Creating the xml for no action button"
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2353,7 +2354,7 @@ if ($ActionButton2Enabled -eq "True") {
Write-Log -Message "This will always enable both action buttons and the dismiss button" -Level Warn
Write-Log -Message "Replacing any previous formatting of the toast xml" -Level Warn
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down Expand Up @@ -2392,7 +2393,7 @@ if ($SnoozeButtonEnabled -eq "True") {
Write-Log -Message "This will always enable the action button as well as the dismiss button" -Level Warn
Write-Log -Message "Replacing any previous formatting of the toast xml" -Level Warn
[xml]$Toast = @"
<toast scenario="$Scenario">
<toast scenario="$Scenario" activationType= "protocol" launch="$LaunchProtocol">
<visual>
<binding template="ToastGeneric">
<image placement="hero" src="$HeroImage"/>
Expand Down
1 change: 1 addition & 0 deletions config-toast-adpwexpiration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<Option Name="HeroImageName" Value="ToastHeroImageDefault.jpg" /> <!-- File name of the image shown in the top of the toast notification -->
<Option Name="ActionButton1" Enabled="True" /> <!-- Enables or disables the action button. -->
<Option Name="ActionButton2" Enabled="True" /> <!-- Enables or disables the action button. -->
<Option Name="LaunchProtocol" Value="microsoft-edge:" /> <!-- Action taken when the notification is clicked. Can be any protocol in Windows -->
<Option Name="DismissButton" Enabled="True" /> <!-- Enables or disables the dismiss button. -->
<Option Name="SnoozeButton" Enabled="False" /> <!-- Enabling this option will always enable action button and dismiss button -->
<Option Name="Scenario" Type="reminder" /> <!-- Possible values are: reminder | short | long -->
Expand Down
1 change: 1 addition & 0 deletions config-toast-officeupgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<Option Name="Scenario" Type="reminder" /> <!-- Possible values are: reminder | short | long -->
<Option Name="Action1" Value="ToastRunApplicationID:" /> <!-- Action taken when using the Action button. Can be any protocol in Windows -->
<Option Name="Action2" Value="https://imab.dk" /> <!-- Action taken when using the Action button. Can be any protocol in Windows -->
<Option Name="LaunchProtocol" Value="microsoft-edge:" /> <!-- Action taken when the notification is clicked. Can be any protocol in Windows -->
<Text Option="GreetGivenName" Enabled="True" /> <!-- Displays the toast with a personal greeting using the users given name retrieved from AD. Will try retrieval from WMI of no local AD -->
<Text Option="MultiLanguageSupport" Enabled="False" /> <!-- Enable support for multiple languages. If set to True, the toast notification will look for the users language culture within the config file -->
<en-US> <!-- Default fallback language. This language will be used if MultiLanguageSupport is set to False or if no matching language is found -->
Expand Down
1 change: 1 addition & 0 deletions config-toast-osupgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<Option Name="HeroImageName" Value="ToastHeroImageWindows.jpg" /> <!-- File name of the image shown in the top of the toast notification -->
<Option Name="ActionButton1" Enabled="True" /> <!-- Enables or disables the action button. -->
<Option Name="ActionButton2" Enabled="True" /> <!-- Enables or disables the action button. -->
<Option Name="LaunchProtocol" Value="microsoft-edge:" /> <!-- Action taken when the notification is clicked. Can be any protocol in Windows -->
<Option Name="DismissButton" Enabled="True" /> <!-- Enables or disables the dismiss button. -->
<Option Name="SnoozeButton" Enabled="False" /> <!-- Enabling this option will always enable action button and dismiss button -->
<Option Name="Scenario" Type="reminder" /> <!-- Possible values are: reminder | short | long -->
Expand Down
1 change: 1 addition & 0 deletions config-toast-rebootpending.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<Option Name="Scenario" Type="reminder" /> <!-- Possible values are: reminder | short | long -->
<Option Name="Action1" Value="ToastReboot:" /> <!-- Action taken when using the Action button. Can be any protocol in Windows -->
<Option Name="Action2" Value="https://imab.dk" /> <!-- Action taken when using the Action button. Can be any protocol in Windows -->
<Option Name="LaunchProtocol" Value="microsoft-edge:" /> <!-- Action taken when the notification is clicked. Can be any protocol in Windows -->
<Text Option="GreetGivenName" Enabled="True" /> <!-- Displays the toast with a personal greeting using the users given name retrieved from AD. Will try retrieval from WMI of no local AD -->
<Text Option="MultiLanguageSupport" Enabled="False" /> <!-- Enable support for multiple languages. If set to True, the toast notification will look for the users language culture within the config file -->
<en-US> <!-- Default fallback language. This language will be used if MultiLanguageSupport is set to False or if no matching language is found -->
Expand Down
1 change: 1 addition & 0 deletions config-toast-waasfu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<Option Name="Scenario" Type="reminder" /> <!-- Possible values are: reminder | short | long -->
<Option Name="Action1" Value="ToastRunUpdateID:" /> <!-- Action taken when using the Action button. Can be any protocol in Windows -->
<Option Name="Action2" Value="https://imab.dk" /> <!-- Action taken when using the Action button. Can be any protocol in Windows -->
<Option Name="LaunchProtocol" Value="microsoft-edge:" /> <!-- Action taken when the notification is clicked. Can be any protocol in Windows -->
<Text Option="GreetGivenName" Enabled="True" /> <!-- Displays the toast with a personal greeting using the users given name retrieved from AD. Will try retrieval from WMI of no local AD -->
<Text Option="MultiLanguageSupport" Enabled="False" /> <!-- Enable support for multiple languages. If set to True, the toast notification will look for the users language culture within the config file -->
<en-US> <!-- Default fallback language. This language will be used if MultiLanguageSupport is set to False or if no matching language is found -->
Expand Down
1 change: 1 addition & 0 deletions config-toast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<Option Name="Scenario" Type="reminder" /> <!-- Possible values are: reminder | short | long | alarm -->
<Option Name="Action1" Value="ToastReboot:" /> <!-- Action taken when using the Action button. Can be any protocol in Windows -->
<Option Name="Action2" Value="https://imab.dk" /> <!-- Action taken when using the Action button. Can be any protocol in Windows -->
<Option Name="LaunchProtocol" Value="microsoft-edge:" /> <!-- Action taken when the notification is clicked. Can be any protocol in Windows -->
<Text Option="GreetGivenName" Enabled="True" /> <!-- Displays the toast with a personal greeting using the users given name retrieved from AD. Will try retrieval from WMI of no local AD -->
<Text Option="MultiLanguageSupport" Enabled="False" /> <!-- Enable support for multiple languages. If set to True, the toast notification will look for the users language culture within the config file -->
<en-US> <!-- Default fallback language. This language will be used if MultiLanguageSupport is set to False or if no matching language is found -->
Expand Down