Transfer resume support .NET Library

Advertisement

TheJelly
Joined:
Posts:
2

Transfer resume support .NET Library

Hello, I'm trying to configure the session options to enable transferresumesupport.
Here's my existing synchronisation script,
try {
    # Connect to the SFTP server
    $session.Open($sessionOptions)
   
   # Enabled transfer with resume support/to temporary filename for all files
   $transferOptions = New-Object WinSCP.TransferOptions
 
    # Synchronize local directory with remote directory (down and up)
    $synchronizationResult = $session.SynchronizeDirectories(
        [WinSCP.SynchronizationMode]::Remote, "$localpath", "$remotepath", $False
    )
 
    # Check for synchronization errors
    $synchronizationResult.Check()
 
    # Print synchronization results
    foreach ($transfer in $synchronizationResult.Downloads) {
        Write-Host "Download of $($transfer.FileName) succeeded"
    }
    foreach ($transfer in $synchronizationResult.Uploads) {
        Write-Host "Upload of $($transfer.FileName) succeeded"
    }
 
} finally {
    # Disconnect and dispose session
    $session.Dispose()
}
I've added the $transferOptions = New-Object WinSCP.TransferOptions line, as you can see. But not sure exactly what the syntax should be for then enabling the ResumeTransferSupport transfer option
https://winscp.net/eng/docs/library_transferresumesupport

Any help would be much appreciated, cheers in advance.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum