From 3eddd0bc1e304516d4b1a1b3c5c4f5ac9a9ad26c Mon Sep 17 00:00:00 2001 From: Howard Wolosky Date: Sat, 30 May 2020 23:59:39 -0700 Subject: [PATCH] UpdateCheck must handle when module is newer than published version Publishing a new version to PowerShellGallery happens a few hours after the version is updated in GitHub. This edge-case meant that someone in this state would have been told that the older published version was newer than the version that they were currently using. --- UpdateCheck.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UpdateCheck.ps1 b/UpdateCheck.ps1 index b2ec5099..c76bb253 100644 --- a/UpdateCheck.ps1 +++ b/UpdateCheck.ps1 @@ -81,7 +81,11 @@ function Invoke-UpdateCheck $script:HasLatestVersion = $latestVersion -eq $moduleVersion if ($script:HasLatestVersion) { - Write-Log "[$moduleName] update check complete. Running latest version: $($latestVersion.ToString())" -Level Verbose + Write-Log "[$moduleName] update check complete. Running latest version: $latestVersion" -Level Verbose + } + elseif ($moduleVersion -gt $latestVersion) + { + Write-Log "[$moduleName] update check complete. This version ($moduleVersion) is newer than the latest published version ($latestVersion)." -Level Verbose } else {