From 93fa1009693546f984c2402be29a8f8a5e45ef47 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 26 Oct 2021 14:10:51 -0700 Subject: [PATCH] Add latest released version to prepare prerelease (#18373) Co-authored-by: Chidozie Ononiwu --- eng/common/scripts/Prepare-Release.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/Prepare-Release.ps1 b/eng/common/scripts/Prepare-Release.ps1 index 2005347822fd..5a8940266bf5 100644 --- a/eng/common/scripts/Prepare-Release.ps1 +++ b/eng/common/scripts/Prepare-Release.ps1 @@ -109,11 +109,15 @@ else $releaseDateString = $ParsedReleaseDate.ToString("MM/dd/yyyy") $month = $ParsedReleaseDate.ToString("MMMM") -Write-Host 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 + $latestReleasedVersion = $releasedVersions[$releasedVersions.Count - 1] + Write-Host "Latest released version: ${latestReleasedVersion}" -ForegroundColor Green +} $currentProjectVersion = $packageProperties.Version - $newVersion = Read-Host -Prompt "Input the new version, or press Enter to use use current project version '$currentProjectVersion'" if (!$newVersion)