I figured out that writing 3 to ShellStream will usually terminate a remote running process:
shellStream.WriteByte(3);
However this doesn't always work. Does anyone know of a way to make this reliable? I tried writing it multiple times but if it didn't work the 1st time it won't work regardless of how many times you send it again.