Skip to content

Commit

Permalink
Update Prepare-Release.ps1 to handle only one previous release (#39139)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
2 people authored and drielenr committed Mar 28, 2024
1 parent 1f5e1f5 commit 42aa1fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eng/common/scripts/Prepare-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 42aa1fa

Please sign in to comment.