From 55c4efdc69a6f6236ab5b3fa10117918d0c9de7a Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Fri, 7 Apr 2023 13:29:55 +0200 Subject: [PATCH] Variables from User-Run moved --- Winget-AutoUpdate/User-Run.ps1 | 4 ---- Winget-AutoUpdate/functions/Start-NotifTask.ps1 | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Winget-AutoUpdate/User-Run.ps1 b/Winget-AutoUpdate/User-Run.ps1 index e3f8151..9ecef3b 100644 --- a/Winget-AutoUpdate/User-Run.ps1 +++ b/Winget-AutoUpdate/User-Run.ps1 @@ -44,10 +44,6 @@ Get-NotifLocale #Set common variables $OnClickAction = "$WorkingDir\logs\updates.log" $Button1Text = $NotifLocale.local.outputs.output[11].message -#The variables afterwards are used within Start-NotifTask.ps1 -$Title = "Winget-AutoUpdate (WAU)" -$Balise = "Winget-AutoUpdate (WAU)" -$UserRun = $True if ($Logs) { if (Test-Path "$WorkingDir\logs\updates.log") { diff --git a/Winget-AutoUpdate/functions/Start-NotifTask.ps1 b/Winget-AutoUpdate/functions/Start-NotifTask.ps1 index e78062d..d01e128 100644 --- a/Winget-AutoUpdate/functions/Start-NotifTask.ps1 +++ b/Winget-AutoUpdate/functions/Start-NotifTask.ps1 @@ -14,6 +14,13 @@ function Start-NotifTask { [Switch]$ButtonDismiss = $false ) + $caller = Get-ChildItem $MyInvocation.PSCommandPath | Select-Object -Expand Name + if ($caller -eq "User-Run.ps1") { + $Title = "Winget-AutoUpdate (WAU)" + $Balise = "Winget-AutoUpdate (WAU)" + $UserRun = $True + } + if (($WAUConfig.WAU_NotificationLevel -eq "Full") -or ($WAUConfig.WAU_NotificationLevel -eq "SuccessOnly" -and $MessageType -eq "Success") -or ($UserRun)) { # XML Toast template creation