Merge branch 'fixws' of git://github.com/efficks/salt into efficks-fixws

This commit is contained in:
Colton Myers 2015-08-25 14:06:54 -06:00
commit 615d3ec219

View File

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