Skip to content

Commit

Permalink
Update Prepare-Release.ps1 to handle only one previous release (#22560)
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
azure-sdk and weshaggard authored Mar 8, 2024
1 parent 5ed9ea4 commit b783755
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 b783755

Please sign in to comment.