Re: Using wodSSH with PowerShell? - WeOnlyDo Discussion board

Re: Using wodSSH with PowerShell? (General questions)

by Sean, Tuesday, March 13, 2012, 22:55 (4636 days ago) @ woddrazen

Sean,


Your prompt should be accepted by our regex because # appear at end of your prompt.

Do you received some error maybe? Which line produce it?


Drazen

Yep, its pretty standard timeout error I get on the connection. Odd, because PuTTy SSH connects instantly with the exact same details - port 22, my username and password. Does user perhaps need to be set username@host instead of just username?

Here is the error:

PowerCLI C:Program Files (x86)VMwareInfrastructurevSphere PowerCLI> $ssh.Connect()
Exception calling Connect with 0 argument(s): The current connection has timed out.
At line:1 char:13
+ $ssh.Connect <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation

PowerCLI C:Program Files (x86)VMwareInfrastructurevSphere PowerCLI>
PowerCLI C:Program Files (x86)VMwareInfrastructurevSphere PowerCLI> $ssh.DataReady = 0

PowerCLI C:Program Files (x86)VMwareInfrastructurevSphere PowerCLI> $ssh.WaitFor( rege
x:[$ #>] $ )
Exception calling WaitFor with 1 argument(s): Cannot receive at this time, not conne
cted.
At line:1 char:13
+ $ssh.WaitFor <<<< ( regex:[$ #>] $ )
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation

PowerCLI C:Program Files (x86)VMwareInfrastructurevSphere PowerCLI> $ssh.Execute( ls -
al`r`n , regex:[$ #>] $ )
Exception calling Execute with 2 argument(s): Cannot receive at this time, not conne
cted.
At line:1 char:13
+ $ssh.Execute <<<< ( ls -al`r`n , regex:[$ #>] $ )
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation

PowerCLI C:Program Files (x86)VMwareInfrastructurevSphere PowerCLI> $ssh.Disconnect()
PowerCLI C:Program Files (x86)VMwareInfrastructurevSphere PowerCLI>


Complete thread: