1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixing bug with stopped state

This commit is contained in:
Chris Hoffman 2014-06-21 22:01:02 -04:00
parent 844e90093b
commit 1c2d244964

View file

@ -68,7 +68,7 @@ If ($state) {
} }
Set-Attr $result "changed" $true; Set-Attr $result "changed" $true;
} }
ElseIf ($state -eq "stopped" -and $svcName -ne "Stopped") { ElseIf ($state -eq "stopped" -and $svc.Status -ne "Stopped") {
try { try {
Stop-Service -Name $svcName -ErrorAction Stop Stop-Service -Name $svcName -ErrorAction Stop
} }