Here is an example of some C# code opening a runspace from a remote connection, then invoking PowerShell.
PSCollection Test(string rem