Created
January 11, 2015 04:52
-
-
Save motemen/0f7fe66fcefb2f000fcf to your computer and use it in GitHub Desktop.
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
$Command = { | |
New-Service -Name MackerelAgentService -BinaryPathName 'C:\Program Files\Windows Resource Kits\Tools\srvany.exe' | |
New-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\MackerelAgentService\Parameters' | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\MackerelAgentService\Parameters' -Name Application 'C:\Go\bin\mackerel-agent.exe -conf C:\mackerel-agent\mackerel-agent.conf -root C:\mackerel-agent' | |
Write-Host '`Start-Service MackerelAgentService` to start service' | |
} | |
Start-Process PowerShell -ArgumentList "-NoExit -Command & { $Command }" -Verb RunAs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment