When working with the expect method, it was discovered the WriteLine was sending an linefeed after a carriage return. This was throwing some SSH implementations off because the linefeed is being interpreted as a second carriage return.
I'm suggesting that:
var commandText = string.Format("{0}{1}", line, "\r\n");
be replaced with
var commandText = string.Format("{0}{1}", line, "\r");
I'm suggesting that:
var commandText = string.Format("{0}{1}", line, "\r\n");
be replaced with
var commandText = string.Format("{0}{1}", line, "\r");