Update Prepare-Release.ps1 to handle only one previous release (#1725)

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 <weshaggard@users.noreply.github.com>
This commit is contained in:
Azure SDK Bot 2024-03-08 14:07:45 -05:00 коммит произвёл GitHub
Родитель 57eea2d51f
Коммит 17914dc68b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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]