Search in sources :

Example 1 with WinRS

use of com.iwave.ext.windows.winrm.winrs.WinRS in project coprhd-controller by CoprHD.

the class WindowsSystemWinRM method executeCommand.

public CommandOutput executeCommand(String commandLine) throws WinRMException {
    WinRS winrs = new WinRS(target);
    debug("Running: %s", commandLine);
    CommandOutput output = winrs.executeCommandLine(commandLine);
    if (output.getExitValue() != 0) {
        debug("Exit Value: %d", output.getExitValue());
    }
    if (StringUtils.isNotBlank(output.getStdout())) {
        debug("STDOUT: \n%s", output.getStdout());
    }
    if (StringUtils.isNotBlank(output.getStderr())) {
        debug("STDERR: \n%s", output.getStderr());
    }
    return output;
}
Also used : WinRS(com.iwave.ext.windows.winrm.winrs.WinRS) CommandOutput(com.iwave.ext.command.CommandOutput)

Aggregations

CommandOutput (com.iwave.ext.command.CommandOutput)1 WinRS (com.iwave.ext.windows.winrm.winrs.WinRS)1