Forked from tekmaven/Install-MongoDb-On-AppVeyor.ps1
Last active
August 29, 2015 14:15
-
-
Save antonioj-mattos/4a5fbab6534e47cfe348 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Make sure 7za is installed | |
| choco install 7zip.commandline | |
| # Create mongodb and data directory | |
| md $env:temp\mongo\data | |
| # Go to mongodb dir | |
| Push-Location $env:temp\mongo | |
| # Download zipped mongodb binaries to mongodbdir | |
| Invoke-WebRequest https://fastdl.mongodb.org/win32/mongodb-win32-i386-2.6.7.zip?_ga=1.44958753.446619509.1416081281 -OutFile mongodb.zip | |
| # Extract mongodb zip | |
| cmd /c 7za e mongodb.zip | |
| # Install mongodb as a windows service | |
| cmd /c $env:temp\mongo\mongod.exe --logpath=$env:temp\mongo\log --dbpath=$env:temp\mongo\data\ --smallfiles --install | |
| # Sleep as a hack to fix an issue where the service sometimes does not finish installing quickly enough | |
| Start-Sleep -Seconds 5 | |
| # Start mongodb service | |
| net start mongodb | |
| # Return to last location, to run the build | |
| Pop-Location | |
| Write-Host | |
| Write-Host "monogdb installation complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment