From 0ead6bb0e2536d2136ecc2ba4af08a7fb4890cf2 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Mon, 5 Mar 2018 15:49:43 +0100
Subject: [PATCH] Set ErrorActionPreference to "Stop".

---
 Scripts/Install-Service.ps1 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Scripts/Install-Service.ps1 b/Scripts/Install-Service.ps1
index d7e5d85..0ed3464 100644
--- a/Scripts/Install-Service.ps1
+++ b/Scripts/Install-Service.ps1
@@ -8,7 +8,7 @@
 function Start-MyService {
     Write-Host -NoNewLine "Starting service $($ServiceName): "
     try {
-        Start-Service $ServiceName -ErrorAction Stop
+        Start-Service $ServiceName
         Write-Host "[OK]" -Fore Green
     }
     catch {
@@ -74,6 +74,9 @@ function Install-Service {
 }
 
 
+$ErrorActionPreference = "Stop"
+
+
 $LocalConfiguration = ".\ScriptsConfig.ps1"
 if (Test-Path $LocalConfiguration) {
     . $LocalConfiguration
-- 
GitLab