Sha256: 0453a3df9aa77ab99c8bd8320eaf6a1c3a059d04293c93311c941ecbdd37856c
Contents?: true
Size: 758 Bytes
Versions: 23
Compression:
Stored size: 758 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 { :stdout => stdout, :stderr => stderr, :exit_status => result[:exitcode], :exit_signal => nil } end end end end
Version data entries
23 entries across 23 versions & 1 rubygems