Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Installing MongoDB
$msiPath = "$($env:USERPROFILE)\mongodb-win32-x86_64-2008plus-ssl-3.0.4-signed.msi"
(New-Object Net.WebClient).DownloadFile('', $msiPath)
cmd /c start /wait msiexec /q /i $msiPath INSTALLLOCATION=C:\mongodb ADDLOCAL="all"
del $msiPath
mkdir c:\mongodb\data\db | Out-Null
mkdir c:\mongodb\log | Out-Null
destination: file
path: c:\mongodb\log\mongod.log
dbPath: c:\mongodb\data\db' | Out-File C:\mongodb\mongod.cfg -Encoding utf8
cmd /c start /wait sc create MongoDB binPath= "C:\mongodb\bin\mongod.exe --service --config=C:\mongodb\mongod.cfg" DisplayName= "MongoDB" start= "demand"
& c:\mongodb\bin\mongod --version
Start-Service mongodb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment