Posh-SSH icon indicating copy to clipboard operation
Posh-SSH copied to clipboard

Invoke-SSHCommand times out quickly even when Timeout parameter is set

Open Cirzen opened this issue 4 years ago • 1 comments

I'm having an issue with Invoke-SSHCommand with timeouts. If I set the timeout to e.g. 2 minutes, I still get an exception from within the CheckAsyncProcessing function and the EndExecute method after approx 30 seconds:

At G:\My Drive\PowerShell\Modules\posh-ssh\2.2\Posh-SSH.psm1:260 char:25                                                
+                         $Output = $_.cmd.EndExecute($_.Async)                                                         
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                         
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException                                           
    + FullyQualifiedErrorId : SshOperationTimeoutException

Looking elsewhere, the timeout on the BeginExecute seems to be set to 50ms. Is it possible to set a user defined timeout for this background processing?

Cirzen avatar Jul 08 '20 09:07 Cirzen

Can you test Beta 2 https://github.com/darkoperator/Posh-SSH/releases/tag/Beta2 I made the change for the timeout

darkoperator avatar Jul 15 '20 12:07 darkoperator