Sha256: 01ecdb219907e435e41606eb359224f9d1c090c909e570658a7e99fd3beda148
Contents?: true
Size: 751 Bytes
Versions: 75
Compression:
Stored size: 751 Bytes
Contents
module SpecInfra module Backend class WinRM < Base include PowerShell::ScriptHelper def run_command(cmd, opts={}) script = create_script(cmd) winrm = SpecInfra.configuration.winrm result = winrm.powershell(script) stdout, stderr = [:stdout, :stderr].map do |s| result[:data].select {|item| item.key? s}.map {|item| item[s]}.join end result[:exitcode] = 1 if result[:exitcode] == 0 and !stderr.empty? if @example @example.metadata[:command] = script @example.metadata[:stdout] = stdout + stderr end CommandResult.new :stdout => stdout, :stderr => stderr, :exit_status => result[:exitcode] end end end end
Version data entries
75 entries across 75 versions & 1 rubygems