From ab50fc5aac2c5e6f369ac6a0e69189950bdab425 Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Sat, 31 Aug 2024 21:20:14 +0200 Subject: [PATCH] Aways download if LastWriteTime not there --- Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 | 8 +++++++- .../Winget-AutoUpdate/functions/Test-ListPath.ps1 | 14 ++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 index 47e95ca..4b50a8d 100644 --- a/Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -185,7 +185,13 @@ if (Test-Network) { $Script:ReachNoPath = $False } if ($NewList) { - Write-ToLog "Newer List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "Yellow" + if ($AlwaysDownloaded) { + Write-ToLog "List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "Yellow" + } + else { + Write-ToLog "Newer List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "Yellow" + } + $Script:AlwaysDownloaded = $False } else { if ($WAUConfig.WAU_UseWhiteList -and (Test-Path "$WorkingDir\included_apps.txt")) { diff --git a/Sources/WAU/Winget-AutoUpdate/functions/Test-ListPath.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Test-ListPath.ps1 index f49c881..37de764 100644 --- a/Sources/WAU/Winget-AutoUpdate/functions/Test-ListPath.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/functions/Test-ListPath.ps1 @@ -54,15 +54,9 @@ function Test-ListPath ($ListPath, $UseWhiteList, $WingetUpdatePath) { } catch { try { - $content = $wc.DownloadString("$ExternalList") - if ($null -ne $content -and $content -match "\w\.\w") { - $wc.DownloadFile($ExternalList, $LocalList) - return $true - } - else { - $Script:ReachNoPath = $True - return $False - } + $wc.DownloadFile($ExternalList, $LocalList) + $Script:AlwaysDownloaded = $True + return $true } catch { $Script:ReachNoPath = $True @@ -93,7 +87,7 @@ function Test-ListPath ($ListPath, $UseWhiteList, $WingetUpdatePath) { } else { $Script:ReachNoPath = $True + return $False } - return $False } }