-
Notifications
You must be signed in to change notification settings - Fork 36
/
Start-EventStore.ps1
27 lines (22 loc) · 981 Bytes
/
Start-EventStore.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Param(
$eventStoreServerLocation = "c:\eventstore\server"
)
$ErrorActionPreference = "inquire"
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
$arguments = "-file """ + $myinvocation.mycommand.definition + """ -eventStoreServerLocation """ + $eventStoreServerLocation + """"
Start-Process "$psHome\powershell.exe" -Verb runAs -ArgumentList $arguments
break
}
Function Get-ScriptDirectory {
Split-Path -parent $PSCommandPath
}
Function StartEventStore($configFile)
{
$srcFolder = Get-ScriptDirectory
$configFullPath = Join-Path $srcFolder -childpath $configFile;
$eventStoreExe = "$eventStoreServerLocation\EventStore.ClusterNode.exe";
$arguments = "--config=`"$configFullPath`"";
Start-Process -WorkingDirectory $eventStoreServerLocation -FilePath $eventStoreExe -ArgumentList $arguments
}
StartEventStore("config.yml");