What exception? Please attach logs.
- martin
ls
command. ExecuteCommand()
seems to generate an exception regardless of the success or failure of the command. I try to compare CommandExecutionResult.Output
immediately after executing the command but that code is never executed because execution has jumped to the exception -
CommandExecutionResult ceResult = session.ExecuteCommand("ls /www");
if (ceResult.Output.ToUpper().Contains("NO SUCH FILE OR DIRECTORY"))
{
session.CreateDirectory(sft.destFile);
}
OperationResultBase
? If so, is there an example of how that is done following ExecuteCommand()
?
session
is not null).
CommandExecutionResult
?
string ceResult = session.ExecuteCommand("ls -al").Output;
CommandExecutionResult ceResult = session.ExecuteCommand("ls " + sft.destFile);
new
keyword as well, but all of these result in the exception -
System.NullReferenceException: 'Object reference not set to an instance of an object.'