diff --git a/support/install-service-factbeat.ps1 b/support/install-service-factbeat.ps1 new file mode 100644 index 0000000..b341743 --- /dev/null +++ b/support/install-service-factbeat.ps1 @@ -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`"" diff --git a/support/uninstall-service-factbeat.ps1 b/support/uninstall-service-factbeat.ps1 new file mode 100644 index 0000000..5186e4b --- /dev/null +++ b/support/uninstall-service-factbeat.ps1 @@ -0,0 +1,4 @@ +if (Get-Service factbeat -ErrorAction SilentlyContinue) { + $service = Get-WmiObject -Class Win32_Service -Filter "name='factbeat'" + $service.delete() +}