[Windows] Pin MongoDB to the specific version defined in the toolset (#4418)

This commit is contained in:
Maksim Shilov
2021-11-10 21:43:42 +03:00
committed by GitHub
parent 596859266e
commit fef060bec8
7 changed files with 48 additions and 2 deletions

View File

@@ -3,7 +3,9 @@
## Desc: Install MongoDB
####################################################################################
Choco-Install -PackageName mongodb
$toolsetVersion = (Get-ToolsetContent).mongodb.version
$latestChocoPackage = Get-LatestChocoPackageVersion -TargetVersion $toolsetVersion -PackageName "mongodb"
Choco-Install -PackageName mongodb -ArgumentList "--version $latestChocoPackage"
$mongoPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'mongodb'").PathName
$mongoBin = Split-Path -Path $mongoPath.split('"')[1]
Add-MachinePathItem "$mongoBin"