Merge pull request #673 from KnifMelti/GitHub_Fix

Aways download if LastWriteTime not there
pull/675/head
Romain 2024-08-31 22:15:12 +02:00 committed by GitHub
commit 123a661142
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 11 deletions

View File

@ -185,8 +185,14 @@ if (Test-Network) {
$Script:ReachNoPath = $False
}
if ($NewList) {
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")) {
Write-ToLog "List (white) is up to date." "Green"

View File

@ -54,16 +54,10 @@ 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)
$Script:AlwaysDownloaded = $True
return $true
}
else {
$Script:ReachNoPath = $True
return $False
}
}
catch {
$Script:ReachNoPath = $True
return $False
@ -93,7 +87,7 @@ function Test-ListPath ($ListPath, $UseWhiteList, $WingetUpdatePath) {
}
else {
$Script:ReachNoPath = $True
}
return $False
}
}
}