Closed jborean93 closed 4 months ago
Thanks for creating the issue, and elaborating on the use-case!
What do you think about this API:
Task<RemoteProcess> ExecuteSubystemAsync(string subsystem CancellationToken cancellationToken);
Task<RemoteProcess> ExecuteSubystemAsync(string subsystem, ExecuteOptions? options = null, CancellationToken cancellationToken = default);
You read my mind as I was working on https://github.com/tmds/Tmds.Ssh/pull/183 which used that exact name!
It would be great if
ExecuteAsync
(or some variant) had a way to specify using a custom subsystem rather than a command. For example the OpenSSH cli can open a connection to a subsystem withssh -s user@remote subsystem_name
.As some background PowerShell Remoting is done through a custom subsystem configuration https://learn.microsoft.com/en-us/powershell/scripting/security/remoting/ssh-remoting-in-powershell?view=powershell-7.4. The SSH service registers a subsystem (typically called
powershell
) that is set to run a set executable with an argument.The PowerShell client internally runs uses
ssh -s user@remote powershell
to open the connection and exchange the PSRemoting packets over stdin/stdout of this new connection. I'm hoping to use this library to achieve the same thing instead of relying on thessh
binary.