This project is read-only.

RunCommand hangs and doesnt timeout either

Aug 15, 2013 at 6:15 AM
Hi All,

I use PowerShell 3.0 with this library and cannot get Runcommand to work. I am trying to connect to a switch and execute a simple command like "show version". Below is the code. It just hangs and doesnt even timeout after 30 seconds.

Anything i am doing wrong here?

$Command = "n show version n"
$connectionInfo = New-Object Renci.SshNet.PasswordConnectionInfo(, 22 , $Username, $Password)
$connectionInfo.Timeout = New-TimeSpan -Seconds 30
$sshClient = New-Object Renci.SshNet.SshClient($connectionInfo)

hangs here and never comes out. ISE is dead and i have to kill it.
$sshOutput = $sshClient.RunCommand($Command)