Class CommandResult

java.lang.Object
org.metricshub.winrm.CommandResult

public final class CommandResult extends Object
The result of a command executed on the remote host: its output streams, its process exit code, and the time it took.
  • Method Details

    • stdout

      public String stdout()
      Get the standard output of the command.
      Returns:
      the stdout content
    • stderr

      public String stderr()
      Get the standard error of the command.
      Returns:
      the stderr content
    • exitCode

      public int exitCode()
      Get the process exit code of the command. Windows may report HRESULT codes as unsigned 32-bit values; they are narrowed to the equivalent signed int.
      Returns:
      the exit code
    • elapsed

      public Duration elapsed()
      Get the time the command took, from request to completion.
      Returns:
      the elapsed time
    • toString

      public String toString()
      Overrides:
      toString in class Object