Skip to content

Commit

Permalink
Add Powershell scripts for Windows service.
Browse files Browse the repository at this point in the history
  • Loading branch information
ninaspitfire committed Feb 9, 2016
1 parent 6ceb6c8 commit bec8de0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions support/install-service-factbeat.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$workdir = Split-Path $MyInvocation.MyCommand.Path

if (Get-Service factbeat -ErrorAction SilentlyContinue) {
$service = Get-WmiObject -Class Win32_Service -Filter "name='factbeat'"
$service.StopService()
Start-Sleep -s 1
$service.delete()
}

New-Service -name factbeat `
-displayName factbeat `
-binaryPathName "`"$workdir\\factbeat.exe`" -c `"$workdir\\factbeat.yml`""
4 changes: 4 additions & 0 deletions support/uninstall-service-factbeat.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if (Get-Service factbeat -ErrorAction SilentlyContinue) {
$service = Get-WmiObject -Class Win32_Service -Filter "name='factbeat'"
$service.delete()
}

0 comments on commit bec8de0

Please sign in to comment.