From http://learnonthejob.blogspot.com/2010/08/exception-handling-for-netssh.html