# File lib/wsman.rb, line 83
  def command(action, url, args = "", count = 0)
    retVal = self.setup_env

    if !retVal
      puts "Unable to ping system...exiting"
      return false
    end

    filename = self.class.certname(@host)
    output = ""
    ret = 0
    stdargs = "-N root/dcim -v -V -o -j utf-8 -y basic"

    self.measure_time "WSMAN #{action} #{url} call" do
      cmd = "wsman #{action} #{url} -h #{@host} -P #{@port} -u #{@user} -p #{@password} -c #{filename} #{stdargs} #{args} 2>&1"
      output = %x{#{cmd}}
      ret = $?.exitstatus
    end

    if ret != 0
      puts "wsman command failed: #{action}"
      puts output

      return false
    end

    if output =~ /Connection failed. response code = 0/
      return false if count >= 3

      puts "Retrying the command: #{count} #{action}"
      sleep 20

      return command(action, url, args, count + 1)
    end

    return output
  end