# File lib/specinfra/backend/cmd.rb, line 12 def run_command(cmd, opts={}) script = create_script(cmd) psh = powershell if os_info[:cygwin] # convert c:\windows... to /cygdrive/c/windows... psh.gsub!("\\", "/") psh.sub!(":", "") psh = psh.prepend("/cygdrive/") end result = execute_script %Q{#{psh} -NoProfile -encodedCommand #{encode_script(script)}} if @example @example.metadata[:command] = script @example.metadata[:stdout] = result[:stdout] + result[:stderr] end CommandResult.new :stdout => result[:stdout], :stderr => result[:stderr], :exit_status => result[:status] end