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