From b0788ded7fa45856a37b156fe5aa526dc9691325 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 28 Nov 2017 21:55:14 -0500 Subject: [PATCH] Make the new stop service with wildcard not error --- .../Src/Tasks/StopWindowsService/StopWindowsServiceIntern.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extensions/WindowsServiceReleaseTasks/Src/Tasks/StopWindowsService/StopWindowsServiceIntern.ps1 b/Extensions/WindowsServiceReleaseTasks/Src/Tasks/StopWindowsService/StopWindowsServiceIntern.ps1 index bed149e..0c17393 100644 --- a/Extensions/WindowsServiceReleaseTasks/Src/Tasks/StopWindowsService/StopWindowsServiceIntern.ps1 +++ b/Extensions/WindowsServiceReleaseTasks/Src/Tasks/StopWindowsService/StopWindowsServiceIntern.ps1 @@ -10,7 +10,7 @@ function StartStopServices( [PSCustomObject[]] $presentServicesArray $servicesNamesArray | ForEach-Object { $serviceName = $_ - $matchingServices = Get-Service -Name $serviceName + $matchingServices = Get-Service -Name $serviceName -ErrorAction SilentlyContinue if ($matchingServices -eq $null) { @@ -58,4 +58,4 @@ function StartStopServices( { $presentServicesArray | % { Set-Service -Name $_.Name -StartupType $startupType } } -} \ No newline at end of file +}