From 6ce3171b67a12c00ce590efa63169cee30f6bf1a Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Tue, 20 Sep 2022 01:02:51 +0200 Subject: [PATCH] Optimized --- Winget-AutoUpdate/functions/Test-ListPath.ps1 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Winget-AutoUpdate/functions/Test-ListPath.ps1 b/Winget-AutoUpdate/functions/Test-ListPath.ps1 index 3598c46..e60e653 100644 --- a/Winget-AutoUpdate/functions/Test-ListPath.ps1 +++ b/Winget-AutoUpdate/functions/Test-ListPath.ps1 @@ -1,4 +1,4 @@ -#Function to check Black/White List Path +#Function to check Black/White List External Path function Test-ListPath ($ListPath, $UseWhiteList) { # UNC, Web or Local Path @@ -24,11 +24,9 @@ function Test-ListPath ($ListPath, $UseWhiteList) { Write-Host("$ExternalList is newer than $LocalList") return $true } - return $false } else { Write-Host "Given path $ListPath type is $PathType and $ExternalList is not available..." - return $false } } elseif ($ListPath -like "http*"){ @@ -43,11 +41,9 @@ function Test-ListPath ($ListPath, $UseWhiteList) { Write-Host("$ExternalList is newer than $LocalList") return $true } - return $false } catch { Write-Host "Given path $ListPath type is $PathType and $ExternalList is not available..." - return $false } } else { @@ -60,18 +56,19 @@ function Test-ListPath ($ListPath, $UseWhiteList) { Write-Host("$ExternalList is newer than $LocalList") return $true } - return $false } else { Write-Host "Given path $ListPath type is $PathType and $ExternalList is not available..." - return $false } } + return $false } $WingetUpdatePath = "$env:ProgramData\Winget-AutoUpdate" $ListPath = "https://www.knifmelti.se" #$ListPath = "D:\Temp" +#$ListPath = "\\TempSERVER" + #$UseWhiteList = $true #White List or Black List in share/online if differs if ($WingetUpdatePath -ne $ListPath){