From c59022bf629329b1ab517172a7290e5f26895019 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Thu, 13 Jun 2024 13:12:28 +0300 Subject: [PATCH 1/2] Fix version update script --- scripts/ValidateProjectVersionUpdated.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ValidateProjectVersionUpdated.ps1 b/scripts/ValidateProjectVersionUpdated.ps1 index 1f4f4a83..21114583 100644 --- a/scripts/ValidateProjectVersionUpdated.ps1 +++ b/scripts/ValidateProjectVersionUpdated.ps1 @@ -56,7 +56,7 @@ Catch { Exit 1 } -$currentPublishedVersion = [System.Management.Automation.SemanticVersion]$nugetIndex.items[0].upper +$currentPublishedVersion = [System.Management.Automation.SemanticVersion]$nugetIndex.items[$nugetIndex.items.Count - 1].upper # Validate that the version number has been updated. if ($currentProjectVersion -le $currentPublishedVersion) { From 6aabe7c85e3589d9af9eb364ba9a7fc303c58ee0 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Thu, 13 Jun 2024 15:40:32 +0300 Subject: [PATCH 2/2] Update script to do sorting --- scripts/ValidateProjectVersionUpdated.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ValidateProjectVersionUpdated.ps1 b/scripts/ValidateProjectVersionUpdated.ps1 index 21114583..c00447df 100644 --- a/scripts/ValidateProjectVersionUpdated.ps1 +++ b/scripts/ValidateProjectVersionUpdated.ps1 @@ -56,7 +56,7 @@ Catch { Exit 1 } -$currentPublishedVersion = [System.Management.Automation.SemanticVersion]$nugetIndex.items[$nugetIndex.items.Count - 1].upper +$currentPublishedVersion = $nugetIndex.items | Select-Object -ExpandProperty upper | ForEach-Object { [System.Management.Automation.SemanticVersion]$_ } | sort-object | Select-Object -Last 1 # Validate that the version number has been updated. if ($currentProjectVersion -le $currentPublishedVersion) {