mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge branch 'fixws' of git://github.com/efficks/salt into efficks-fixws
This commit is contained in:
commit
615d3ec219
@ -8,6 +8,7 @@ from __future__ import absolute_import
|
||||
import salt.utils
|
||||
import time
|
||||
import logging
|
||||
import os
|
||||
from subprocess import list2cmdline
|
||||
from salt.ext.six.moves import zip
|
||||
from salt.ext.six.moves import range
|
||||
@ -45,9 +46,13 @@ def has_powershell():
|
||||
|
||||
salt '*' service.has_powershell
|
||||
'''
|
||||
return 'powershell' in __salt__['cmd.run'](
|
||||
['where', 'powershell'], python_shell=False
|
||||
)
|
||||
for path in os.environ["PATH"].split(os.pathsep):
|
||||
path = path.strip('"')
|
||||
fullpath = os.path.join(path, "powershell.exe")
|
||||
fullpath = os.path.normpath(fullpath)
|
||||
if os.path.isfile(fullpath) and os.access(fullpath, os.X_OK):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def get_enabled():
|
||||
|
Loading…
Reference in New Issue
Block a user