From d4502794fe49a5cce5573757ea1a57c36a3c501c Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Sat, 2 Sep 2023 05:15:26 +0200 Subject: [PATCH] Test if _WAU-mods.ps1 exist --- Winget-AutoUpdate/Winget-Upgrade.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Winget-AutoUpdate/Winget-Upgrade.ps1 index 9524a79..e7bfcf9 100644 --- a/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -179,6 +179,19 @@ if (Test-Network) { } } + #Test if _WAU-mods.ps1 exist + $Mods = "$WorkingDir\mods" + if (Test-Path "$Mods\_WAU-mods.ps1") { + Write-ToLog "Running Mods for WAU..." "Yellow" + & "$Mods\_WAU-mods.ps1" + $ModsExitCode = $LASTEXITCODE + if ($ModsExitCode -eq 1) { + Write-ToLog "Re-run WAU" + Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"$WorkingDir\winget-upgrade.ps1`"" + Exit + } + } + if ($($WAUConfig.WAU_ListPath) -eq "GPO") { $Script:GPOList = $True }