Skip to content

Commit ee767c2

Browse files
Update Prepare-Release.ps1 to handle only one previous release (#34708)
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. Co-authored-by: Wes Haggard <[email protected]>
1 parent 256e783 commit ee767c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eng/common/scripts/Prepare-Release.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ $month = $ParsedReleaseDate.ToString("MMMM")
116116
Write-Host "Assuming release is in $month with release date $releaseDateString" -ForegroundColor Green
117117
if (Test-Path "Function:GetExistingPackageVersions")
118118
{
119-
$releasedVersions = GetExistingPackageVersions -PackageName $packageProperties.Name -GroupId $packageProperties.Group
119+
$releasedVersions = @(GetExistingPackageVersions -PackageName $packageProperties.Name -GroupId $packageProperties.Group)
120120
if ($null -ne $releasedVersions -and $releasedVersions.Count -gt 0)
121121
{
122122
$latestReleasedVersion = $releasedVersions[$releasedVersions.Count - 1]

0 commit comments

Comments
 (0)