From fd8b1e2082997f8392498e72eb4984f95c1abc8f Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Thu, 7 Mar 2024 09:23:18 -0800 Subject: [PATCH] Update Prepare-Release.ps1 to handle only one previous release In the case there is exactly one previous release PS will return the single object and thus the Count property will not exist. Instead this change ensures that we always have a list. --- eng/common/scripts/Prepare-Release.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Prepare-Release.ps1 b/eng/common/scripts/Prepare-Release.ps1 index 269fd113fd..e82c5982ac 100644 --- a/eng/common/scripts/Prepare-Release.ps1 +++ b/eng/common/scripts/Prepare-Release.ps1 @@ -116,7 +116,7 @@ $month = $ParsedReleaseDate.ToString("MMMM") Write-Host "Assuming release is in $month with release date $releaseDateString" -ForegroundColor Green if (Test-Path "Function:GetExistingPackageVersions") { - $releasedVersions = GetExistingPackageVersions -PackageName $packageProperties.Name -GroupId $packageProperties.Group + $releasedVersions = @(GetExistingPackageVersions -PackageName $packageProperties.Name -GroupId $packageProperties.Group) if ($null -ne $releasedVersions -and $releasedVersions.Count -gt 0) { $latestReleasedVersion = $releasedVersions[$releasedVersions.Count - 1]