Powershell & transferresumesupport in .net/beta version

Advertisement

paolop
Joined:
Posts:
2
Location:
Far East

Powershell & transferresumesupport in .net/beta version

Hello,
maybe somebody will be so kind as to help me out.

I'm trying to run a PS script to upload (large) backup files to a Gluster node. It seems I can't turn off the creation of temporary files on the target, and this causes problems with Gluster locking/replicating the 'filepart' files.

Can anybody suggest what I might be doing wrong? (I'm not a scripting guy, please forgive stupid mistakes)

Here are the relevant lines in the script...

[Reflection.Assembly]::LoadFrom("c:\program files (x86)\winscp\WinSCPnet.dll") | Out-Null
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
...
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off
...
$session = New-Object WinSCP.Session
$session.Open($sessionOptions)
...
$transferResult = $session.PutFiles($fullfilename, $remotePath, $transferOptions)

I also tried setting TransferResumeSupportState to ::Smart and setting a Threshold of 10000000 (10 G), but it does not work either (is threshold a 16-bit integer or a 32-bit integer?)

Any idea what I am doing wrong?

Thanks!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,287
Location:
Prague, Czechia

Re: Powershell & transferresumesupport in .net/beta version

paolop wrote:

$transferResult = $session.PutFiles($fullfilename, $remotePath, $transferOptions)
options is fourth parameter of Session.PutFiles, while you pass it to third parameter, what is remove.
https://winscp.net/eng/docs/library_session_putfiles
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum