Merge pull request #13170 from UtahDave/win_restart

Use powershell, when available, to restart a service.
This commit is contained in:
Thomas S Hatch 2014-06-02 12:52:18 -06:00
commit f2808f29fc

View File

@ -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)