From 1c2d244964fea876740a6d2998b193f0c227161d Mon Sep 17 00:00:00 2001 From: Chris Hoffman Date: Sat, 21 Jun 2014 22:01:02 -0400 Subject: [PATCH] Fixing bug with stopped state --- library/windows/win_service.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/windows/win_service.ps1 b/library/windows/win_service.ps1 index bed140e7ffe..70a3aa0005c 100644 --- a/library/windows/win_service.ps1 +++ b/library/windows/win_service.ps1 @@ -68,7 +68,7 @@ If ($state) { } Set-Attr $result "changed" $true; } - ElseIf ($state -eq "stopped" -and $svcName -ne "Stopped") { + ElseIf ($state -eq "stopped" -and $svc.Status -ne "Stopped") { try { Stop-Service -Name $svcName -ErrorAction Stop }