Skip to content

Commit 58ee2cc

Browse files
committed
Land rapid7#3390, Fix have_powershell
2 parents 823f31d + aa85cb8 commit 58ee2cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/msf/core/post/windows/powershell.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ module Powershell
1919
# Returns true if powershell is installed
2020
#
2121
def have_powershell?
22-
cmd_out = cmd_exec("powershell get-host")
23-
return true if cmd_out =~ /Name.*Version.*InstanceID/
22+
cmd_out = cmd_exec('cmd.exe /c "echo. | powershell get-host"')
23+
return true if cmd_out =~ /Name.*Version.*InstanceId/m
2424
return false
2525
end
2626

0 commit comments

Comments
 (0)