TimeSpan timeout = command.getTimeout();
if (command.getKeyPair() != null) {
SshConnection agentConnection = sshConnection.buildAgentConnection(command.getKeyPair());
try {
return agentConnection.sshExecute(commandString, timeout);
} finally {
agentConnection.close();
}
} else {
return sshConnection.sshExecute(commandString, timeout);