From 4f7f62a9f692db57c4609b8a2ddee273a5eb7d7f Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Tue, 11 Oct 2022 18:04:25 +0200 Subject: [PATCH] WorkingDir as in NotifLocale --- Winget-AutoUpdate/functions/Start-NotifTask.ps1 | 2 +- Winget-AutoUpdate/user-run.ps1 | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Winget-AutoUpdate/functions/Start-NotifTask.ps1 b/Winget-AutoUpdate/functions/Start-NotifTask.ps1 index c252cf9..f635e6b 100644 --- a/Winget-AutoUpdate/functions/Start-NotifTask.ps1 +++ b/Winget-AutoUpdate/functions/Start-NotifTask.ps1 @@ -2,7 +2,7 @@ function Start-NotifTask ($Title, $Message, $MessageType, $Balise, $OnClickAction) { - if (($WAUConfig.WAU_NotificationLevel -eq "Full") -or ($WAUConfig.WAU_NotificationLevel -eq "SuccessOnly" -and $MessageType -eq "Success") -or ($userrun)) { + if (($WAUConfig.WAU_NotificationLevel -eq "Full") -or ($WAUConfig.WAU_NotificationLevel -eq "SuccessOnly" -and $MessageType -eq "Success") -or ($UserRun)) { #Prepare OnClickAction (if set) if ($OnClickAction){ diff --git a/Winget-AutoUpdate/user-run.ps1 b/Winget-AutoUpdate/user-run.ps1 index 9db8f7d..d122619 100644 --- a/Winget-AutoUpdate/user-run.ps1 +++ b/Winget-AutoUpdate/user-run.ps1 @@ -26,24 +26,24 @@ param( <# MAIN #> #Get Working Dir -$Script:WorkingDir = $PSScriptRoot +$Script:WorkingDir = $WorkingDir #Load functions -. $PSScriptRoot\functions\Get-NotifLocale.ps1 -. $PSScriptRoot\functions\Start-NotifTask.ps1 +. $WorkingDir\functions\Get-NotifLocale.ps1 +. $WorkingDir\functions\Start-NotifTask.ps1 #Set common variables -$OnClickAction = "$PSScriptRoot\logs\updates.log" +$OnClickAction = "$WorkingDir\logs\updates.log" $Title = "Winget-AutoUpdate (WAU)" $Balise = "Winget-AutoUpdate (WAU)" -$userrun = $True +$UserRun = $True #Get Toast Locale function Get-NotifLocale if ($Logs) { - if ((Test-Path "$PSScriptRoot\logs\updates.log")) { - Invoke-Item "$PSScriptRoot\logs\updates.log" + if ((Test-Path "$WorkingDir\logs\updates.log")) { + Invoke-Item "$WorkingDir\logs\updates.log" } else { #Not available yet