Posh-SSH
Posh-SSH copied to clipboard
Invoke-SSHCommand times out quickly even when Timeout parameter is set
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?
Can you test Beta 2 https://github.com/darkoperator/Posh-SSH/releases/tag/Beta2 I made the change for the timeout