diff --git a/images/windows/scripts/build/Install-MongoDB.ps1 b/images/windows/scripts/build/Install-MongoDB.ps1 index 167308122..a45dbc562 100644 --- a/images/windows/scripts/build/Install-MongoDB.ps1 +++ b/images/windows/scripts/build/Install-MongoDB.ps1 @@ -39,19 +39,18 @@ $mongodbService.WaitForStatus('Running', '00:01:00') Stop-Service $mongodbService $mongodbService | Set-Service -StartupType Disabled -# Install mongodb shell for mongodb > 5 version -if (Test-IsWin25) { - $mongoshVersion = (Get-GithubReleasesByVersion -Repo "mongodb-js/mongosh" -Version "latest").version +# Install mongodb shell for mongodb +$mongoshVersion = (Get-GithubReleasesByVersion -Repo "mongodb-js/mongosh" -Version "latest").version - $mongoshDownloadUrl = Resolve-GithubReleaseAssetUrl ` - -Repo "mongodb-js/mongosh" ` - -Version $mongoshVersion ` - -UrlMatchPattern "mongosh-*-x64.msi" +$mongoshDownloadUrl = Resolve-GithubReleaseAssetUrl ` + -Repo "mongodb-js/mongosh" ` + -Version $mongoshVersion ` + -UrlMatchPattern "mongosh-*-x64.msi" + +Install-Binary -Type MSI ` + -Url $mongoshDownloadUrl ` + -ExtraInstallArgs @('ALLUSERS=1') ` + -ExpectedSubject 'CN="MongoDB, Inc.", O="MongoDB, Inc.", L=New York, S=New York, C=US' - Install-Binary -Type MSI ` - -Url $mongoshDownloadUrl ` - -ExtraInstallArgs @('ALLUSERS=1') ` - -ExpectedSubject 'CN="MongoDB, Inc.", O="MongoDB, Inc.", L=New York, S=New York, C=US' -} Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB" diff --git a/images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1 b/images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1 index bcbfba410..59bf80543 100644 --- a/images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1 +++ b/images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1 @@ -193,9 +193,8 @@ $databaseTools.AddToolVersion("DacFx", $(Get-DacFxVersion)) $databaseTools.AddToolVersion("MySQL", $(Get-MySQLVersion)) $databaseTools.AddToolVersion("SQL OLEDB Driver", $(Get-SQLOLEDBDriverVersion)) $databaseTools.AddToolVersion("SQLPS", $(Get-SQLPSVersion)) -if (Test-IsWin25) { - $databaseTools.AddToolVersion("MongoDB Shell (mongosh)", $(Get-MongoshVersion)) -} +$databaseTools.AddToolVersion("MongoDB Shell (mongosh)", $(Get-MongoshVersion)) + # Web Servers $installedSoftware.AddHeader("Web Servers").AddTable($(Build-WebServersSection)) diff --git a/images/windows/scripts/docs-gen/SoftwareReport.Databases.psm1 b/images/windows/scripts/docs-gen/SoftwareReport.Databases.psm1 index a831c92be..ccaf754f5 100644 --- a/images/windows/scripts/docs-gen/SoftwareReport.Databases.psm1 +++ b/images/windows/scripts/docs-gen/SoftwareReport.Databases.psm1 @@ -21,11 +21,7 @@ function Get-PostgreSQLTable function Get-MongoDBTable { $name = "MongoDB" - if (Test-IsWin25) { - $command = "mongod" - } else { - $command = "mongo" - } + $command = "mongod" $mongoService = Get-Service -Name $name $mongoVersion = (Get-Command -Name $command).Version.ToString() return [PSCustomObject]@{ diff --git a/images/windows/scripts/tests/Databases.Tests.ps1 b/images/windows/scripts/tests/Databases.Tests.ps1 index de30a2616..03d892108 100644 --- a/images/windows/scripts/tests/Databases.Tests.ps1 +++ b/images/windows/scripts/tests/Databases.Tests.ps1 @@ -1,11 +1,7 @@ Describe "MongoDB" { Context "Version" { It "" -TestCases @( - if (Test-IsWin25) { - @{ ToolName = "mongos" } - } else { - @{ ToolName = "mongo" } - } + @{ ToolName = "mongos" } @{ ToolName = "mongod" } ) { $toolsetVersion = (Get-ToolsetContent).mongodb.version @@ -30,7 +26,7 @@ Describe "MongoDB" { } } - Context "Shell" -Skip:(-not (Test-IsWin25)) { + Context "Shell" { It "mongosh" { "mongosh --version" | Should -ReturnZeroExitCode } diff --git a/images/windows/toolsets/toolset-2022.json b/images/windows/toolsets/toolset-2022.json index b80b91cf8..b1aa580c0 100644 --- a/images/windows/toolsets/toolset-2022.json +++ b/images/windows/toolsets/toolset-2022.json @@ -345,7 +345,7 @@ "version": "8.0" }, "mongodb": { - "version": "5.0" + "version": "7.0" }, "nsis": { "version": "3.10"