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"