public string CommandWithStdIn(string command, string stdIn) { using (var client = Ssh()) { var wrapper = new SshClientWrapper(client); var result = wrapper.RunWithStdIn(command, new string[] { stdIn }); return(result); } }
public string ScriptWithStdIn(string scriptContent, string scriptName, string[] inputs) { using (var scpClient = Scp()) { var stream = new MemoryStream(Encoding.UTF8.GetBytes(scriptContent)); scpClient.Upload(stream, scriptName); } using (var client = Ssh()) { var wrapper = new SshClientWrapper(client); var result = wrapper.RunWithStdIn("sh " + scriptName, inputs); return(result); } }