Skip to content

Commit

Permalink
Fixes #322. Check if powershell not on windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
ptnapoleon committed Jul 2, 2015
1 parent 425a448 commit 749a93d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ccmlib/common.py
Expand Up @@ -233,7 +233,10 @@ def is_ps_unrestricted():
if not is_win():
raise CCMError("Can only check PS Execution Policy on Windows")
else:
p = subprocess.Popen(['powershell', 'Get-ExecutionPolicy'], stdout=subprocess.PIPE)
try:
p = subprocess.Popen(['powershell', 'Get-ExecutionPolicy'], stdout=subprocess.PIPE)
except WindowsError:
print_("ERROR: Could not find powershell. Is it in your path?")
if "Unrestricted" in p.communicate()[0]:
return True
else:
Expand Down

0 comments on commit 749a93d

Please sign in to comment.