diff --git a/windows/win_service.ps1 b/windows/win_service.ps1 index bed140e7ffe..70a3aa0005c 100644 --- a/windows/win_service.ps1 +++ b/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 }