From 4ea41b2f200a26a348e3d2c8fffd4b5390496b22 Mon Sep 17 00:00:00 2001 From: sergei-pyshnoi <121864472+sergei-pyshnoi@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:57:16 +0200 Subject: [PATCH] add filter for upcoming version in mongodb parser (#8589) --- images/win/scripts/Installers/Install-MongoDB.ps1 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/images/win/scripts/Installers/Install-MongoDB.ps1 b/images/win/scripts/Installers/Install-MongoDB.ps1 index 0387aa26..82b1a36d 100644 --- a/images/win/scripts/Installers/Install-MongoDB.ps1 +++ b/images/win/scripts/Installers/Install-MongoDB.ps1 @@ -6,14 +6,16 @@ # Install mongodb package $toolsetVersion = (Get-ToolsetContent).mongodb.version -$getMongoReleases = Invoke-WebRequest -Uri "https://www.mongodb.com/docs/v$toolsetVersion/release-notes/$toolsetVersion-changelog/" -UseBasicParsing -$TargetReleases = $getMongoReleases.Links.href | Where-Object {$_ -like "#$toolsetVersion*-changelog"} +$getMongoReleases = Invoke-WebRequest -Uri "mongodb.com/docs/manual/release-notes/$toolsetVersion/" -UseBasicParsing +$TargetReleases = $getMongoReleases.Links.href | Where-Object {$_ -like "#$toolsetVersion*---*"} $MinorVersions = @() foreach ($release in $TargetReleases) { - $pattern = '\d+\.\d+\.\d+' - $version = $release | Select-String -Pattern $pattern -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value } - $MinorVersions += $version + if ($release -notlike "*upcoming*") { + $pattern = '\d+\.\d+\.\d+' + $version = $release | Select-String -Pattern $pattern -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value } + $MinorVersions += $version + } } $LatestVersion = $MinorVersions[0] @@ -39,4 +41,4 @@ $svc.WaitForStatus('Running','00:01:00') Stop-Service -Name $mongodbService Set-Service $mongodbService -StartupType Disabled -Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB" \ No newline at end of file +Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB"