Created
October 1, 2014 08:14
-
-
Save DotTech/b075b6fd2e175c77a173 to your computer and use it in GitHub Desktop.
Sitecore xDB: Install & start MongoDB as Windows service
This file contains 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
$service = Get-WmiObject -Class Win32_Service -Filter "Name='MongoDB'" | |
if ($service -eq $null) | |
{ | |
$MongoPath = "d:\mongo\mongod.exe" | |
$MongoLogPath = "d:\mongo\logs\mongod.log" | |
$MongoDataFolder = "d:\mongo\data" | |
$binaryPath = "`"$MongoPath`" --service --logpath `"$MongoLogPath`" --dbpath `"$MongoDataFolder`"" | |
New-Service -Name MongoDB -BinaryPathName $binaryPath -Description "MongoDB for Sitecore EMS" -DisplayName "MongoDB" -StartupType auto | Out-Null | |
$service = Get-WmiObject -Class Win32_Service -Filter "Name='MongoDB'" | |
} | |
$service.StartService() | Out-Null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment