diff --git a/CustomMessage.xml b/CustomMessage.xml
index 1b39fe2..809f1be 100644
--- a/CustomMessage.xml
+++ b/CustomMessage.xml
@@ -6,4 +6,5 @@
We are currently experiencing problems with all our systems. We are drinking coffee will provide an update shortly. Thank you for your patience
Details
https://byteben.com
+ Snooze
\ No newline at end of file
diff --git a/Toast_Notify.ps1 b/Toast_Notify.ps1
index eb1c2f6..b3016c0 100644
--- a/Toast_Notify.ps1
+++ b/Toast_Notify.ps1
@@ -36,6 +36,7 @@ Toast_Notify.ps1
Param
(
[Parameter(Mandatory = $False)]
+ [Switch]$Snooze,
[String]$XMLScriptDirSource = "CustomMessage.xml",
[String]$XMLOtherSource
@@ -82,6 +83,7 @@ If ($XMLValid -eq $True) {
$EventText = $XMLToast.ToastContent.EventText
$ButtonTitle = $XMLToast.ToastContent.ButtonTitle
$ButtonAction = $XMLToast.ToastContent.ButtonAction
+ $SnoozeTitle = $XMLToast.ToastContent.SnoozeTitle
#ToastDuration: Short = 7s, Long = 25s
$ToastDuration = "long"
@@ -99,7 +101,7 @@ If ($XMLValid -eq $True) {
$Launcherid = "MSEdge"
#Get last(current) logged on user
- $LoggedOnUserPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI"
+ $LoggedOnUserPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnDisplayName"
If (!(Test-Path $LoggedOnUserPath)) {
Try {
$Firstname = $Null
@@ -127,8 +129,10 @@ If ($XMLValid -eq $True) {
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
- #Build XML Template
- [xml]$ToastTemplate = @"
+ If (!$Snooze) {
+
+ #Build XML Template when Snooze Timer is not specified
+ [xml]$ToastTemplate = @"
@@ -156,7 +160,47 @@ If ($XMLValid -eq $True) {
"@
+ }
+ else {
+ #Build XML Template when Snooze Timer is specified
+ [xml]$ToastTemplate = @"
+
+
+
+ $CustomHello
+ $ToastTitle
+ $Signature
+
+
+
+
+ $EventTitle
+
+
+
+
+ $EventText
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+"@
+ }
#Prepare XML
$ToastXml = [Windows.Data.Xml.Dom.XmlDocument]::New()
$ToastXml.LoadXml($ToastTemplate.OuterXml)