Hi Everyone,
When I run a simple command using SSH Run Shell command activity, it is throwing Object reference not set an instance of object exception.
Note: I’m using this activity inside the SSH connect scope.
Hi @rahulsharma ,
I’m just running the echo command. I tried setting the Options as well in the properties (except Shell Stream, I don’t know how to get that object), but no use.
Hi @Srini84 ,
it’s authenticating. I’ve executed the same command using SSH Run Command activity, it is working fine. But SSH Run Shell Command is only not working.
On the SSH Connect Scope you need to provide a regex for Shell Expected Prompt, otherwise a shell isn’t created (the description says this too, see screenshot below)
In order to keep the session open, the activity needs to know when the command returned. To do this it will check the regex against the response received from the server. When it finds the regex, it will stop and it will return whatever it collected until that point.
There are several thing to be aware of:
if the regex matches something from the command output then the result will be truncated
if you have a fancy shell that changes the prompt based on context, then you either have to account for this in your regex or have a fixed prompt for that particular user
the check exit check seems to be implemented only for sh or bash shells. For me on powershell, it failed.