From fdfcdc98584020684db0fa9a676e2a215028654e Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Tue, 8 Nov 2022 01:09:52 +0100 Subject: [PATCH] Fix date and time check in loop --- Winget-AutoUpdate/functions/Test-ModsPath.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Winget-AutoUpdate/functions/Test-ModsPath.ps1 b/Winget-AutoUpdate/functions/Test-ModsPath.ps1 index a289011..7dda8a5 100644 --- a/Winget-AutoUpdate/functions/Test-ModsPath.ps1 +++ b/Winget-AutoUpdate/functions/Test-ModsPath.ps1 @@ -38,6 +38,8 @@ function Test-ModsPath ($ModsPath, $WingetUpdatePath) { #Check for .ps1 in listing/HREF:s in an index page pointing to .ps1 if ($_ -like "*.ps1") { try { + $dateExternalMod = "" + $dateLocalMod ="" $wc.OpenRead("$ExternalMods/$_").Close() | Out-Null $dateExternalMod = ([DateTime]$wc.ResponseHeaders['Last-Modified']).ToString("yyyy-MM-dd HH:mm:ss") if (Test-Path -Path $LocalMods"\"$_) {