This is not a post about .Net remoting. And its not a post about accessing PowerShell through ssh. Here I'm talking about sending remote executions through rexec, rshell, and secure shell connections.
Rexec and Rshell (rsh.exe) already exist as command line applications, but they do not exists in the PowerShell world (that is, they do not return objects). NetCmdlets send-rexec and send-rshell cmdlets take care of this problem. Each remote execution returns a collection of objects that contain the text and whether or not an EOL was present for each line, like so:
The send-rshell cmdlet gives the exact same output:
For secure shell connections, NetCmdlets provides the send-ssh cmdlet. In the first send-ssh example below I just specify my ssh server, user, password, and a command (ls). It gives similar output:
You'll notice there that the cmdlet stops me to show me the fingerprint presented by the server and make sure I want to accept this host key and continue on. I say yes and the objects are returned. Alternatively I can tell the send-ssh cmdlet the host key fingerprint to accept in the first place, so that it will not require user interaction: