Skip to content

Commit

Permalink
Merge branch 'COOK-988'
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Feb 13, 2012
2 parents f2a0614 + b7f4839 commit 88e9fad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion powershell/libraries/core.rb
Expand Up @@ -57,7 +57,10 @@ def action_run

# always set the ExecutionPolicy flag
# see http://technet.microsoft.com/en-us/library/ee176961.aspx
@new_resource.flags("#{@new_resource.flags} -ExecutionPolicy RemoteSigned -Command".strip)
# Powershell will hang if stdin is redirected
# http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected
@new_resource.flags("#{@new_resource.flags} -ExecutionPolicy RemoteSigned -inputformat none -Command".strip)

# cwd hax...shell_out on windows needs to support proper 'cwd'
# follow CHEF-2357 for more
cwd = @new_resource.cwd ? "cd #{@new_resource.cwd} & " : ""
Expand Down
2 changes: 1 addition & 1 deletion powershell/libraries/helper.rb
Expand Up @@ -26,7 +26,7 @@ module Helper

def powershell_installed?
begin
cmd = shell_out("#{interpreter} -Command \"& {Get-Host}\"")
cmd = shell_out("#{interpreter} -inputformat none -Command \"& {Get-Host}\"")
cmd.stderr.empty? && (cmd.stdout =~ /Version\s*:\s*2.0/i)
rescue Errno::ENOENT
false
Expand Down

0 comments on commit 88e9fad

Please sign in to comment.