Skip to content

Commit 4ea41b2

Browse files
add filter for upcoming version in mongodb parser (#8589)
1 parent b06da59 commit 4ea41b2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

images/win/scripts/Installers/Install-MongoDB.ps1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
# Install mongodb package
77
$toolsetVersion = (Get-ToolsetContent).mongodb.version
88

9-
$getMongoReleases = Invoke-WebRequest -Uri "https://www.mongodb.com/docs/v$toolsetVersion/release-notes/$toolsetVersion-changelog/" -UseBasicParsing
10-
$TargetReleases = $getMongoReleases.Links.href | Where-Object {$_ -like "#$toolsetVersion*-changelog"}
9+
$getMongoReleases = Invoke-WebRequest -Uri "mongodb.com/docs/manual/release-notes/$toolsetVersion/" -UseBasicParsing
10+
$TargetReleases = $getMongoReleases.Links.href | Where-Object {$_ -like "#$toolsetVersion*---*"}
1111

1212
$MinorVersions = @()
1313
foreach ($release in $TargetReleases) {
14-
$pattern = '\d+\.\d+\.\d+'
15-
$version = $release | Select-String -Pattern $pattern -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value }
16-
$MinorVersions += $version
14+
if ($release -notlike "*upcoming*") {
15+
$pattern = '\d+\.\d+\.\d+'
16+
$version = $release | Select-String -Pattern $pattern -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value }
17+
$MinorVersions += $version
18+
}
1719
}
1820

1921
$LatestVersion = $MinorVersions[0]
@@ -39,4 +41,4 @@ $svc.WaitForStatus('Running','00:01:00')
3941
Stop-Service -Name $mongodbService
4042
Set-Service $mongodbService -StartupType Disabled
4143

42-
Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB"
44+
Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB"

0 commit comments

Comments
 (0)