Skip to content

Commit

Permalink
Update Prepare-Release.ps1 to handle only one previous release
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.
  • Loading branch information
weshaggard authored and azure-sdk committed Mar 7, 2024
1 parent e4d495c commit b0e9690
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 b0e9690

Please sign in to comment.