Thanks. That helps.
I had never used a TimeSpan in PowerShell before, but setting it up turned out to be pretty simple. Here's the code I used:
# Setup sFTPSession options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::Sftp
HostName = $strTargetHostName
UserName = $strTargetUserName
Password = $strTargetPassword
SshHostKeyFingerprint = $strTargetFingerprint
Timeout = New-TimeSpan -Seconds 30 #increase from default of 15 seconds
}
The New-TimeSpan cmdlet can specify -Minutes, -Hours, etc. as well.
And it seems to have helped with the timeout issue I was having.
Much appreciated.
I had never used a TimeSpan in PowerShell before, but setting it up turned out to be pretty simple. Here's the code I used:
# Setup sFTPSession options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::Sftp
HostName = $strTargetHostName
UserName = $strTargetUserName
Password = $strTargetPassword
SshHostKeyFingerprint = $strTargetFingerprint
Timeout = New-TimeSpan -Seconds 30 #increase from default of 15 seconds
}
The New-TimeSpan cmdlet can specify -Minutes, -Hours, etc. as well.
And it seems to have helped with the timeout issue I was having.
Much appreciated.