mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #13170 from UtahDave/win_restart
Use powershell, when available, to restart a service.
This commit is contained in:
commit
f2808f29fc
@ -233,6 +233,9 @@ def restart(name):
|
|||||||
|
|
||||||
salt '*' service.restart <service name>
|
salt '*' service.restart <service name>
|
||||||
'''
|
'''
|
||||||
|
if has_powershell():
|
||||||
|
cmd = 'Restart-Service {0}'.format(name)
|
||||||
|
return not __salt__['cmd.retcode'](cmd, shell='powershell')
|
||||||
stop(name)
|
stop(name)
|
||||||
return start(name)
|
return start(name)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user