Unattended Installation of MongoDB

Not sure where to post this question, if this is not the right place - please tell me where I can send this. I have been trying to install MongoDB via the command prompt using PowerShell and I have had a not so pleasant experience. It installs however its different from a GUI installation, it also does not show up in add/remove programs when installing from the command prompt. This is my initial script which is in PowerShell. I had to created the directories if not it bombed out. Ideally I need to get to a point where the command line install is exactly the same as the GUI install. This is for quick scripted deployments.

pushd $PSScriptRoot

$FolderLocation = “C:\Program Files\MongoDB\Server\4.0”
New-Item -Path $FolderLocation -Name data -ItemType “directory” -Force
New-Item -Path $FolderLocation -Name logs -ItemType “directory” -Force
New-Item -Path $FolderLocation -Name bin -ItemType “directory” -Force

$MSI = “mongodb-win32-x86_64-2008plus-ssl-4.0.8-signed.msi”
msiexec /i “$MSI” /qn

Think I found the answer, let me try these arguments https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/

1 Like

I don’t know if I should open a new topic… but, I am unable to install correctly “mongod” using the ADDLOCAL=“ServerNoService” option. If I use that, no mongod.exe is installed at all. Can anyone help me?
Mongo 5 with “mongodb-windows-x86_64-5.0.3-signed.msi”
INSTALLLOCATION="[MONGO_INSTALL_FOLDER]" ADDLOCAL=“Server,ServerNoService,Router,Client,MiscellaneousTools” SHOULD_INSTALL_COMPASS=“0”