Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Guest

.NET assembly TransferOption to limit speed of transfers

Hello. I am using the example PowerShell script from the .NET assembly documentation to synchronize directories, and I want to limit the bandwidth of the transfers. I have added the following lines for the TransferOptions:

$transferoptions = New-Object WinSCP.TransferOptions

    $transferoptions.SpeedLimit = '1024'

And I added the $transferoptions to the end of the synchronize line:

   $synchronizationResult = $session.SynchronizeDirectories(

            [WinSCP.SynchronizationMode]::local, "C:\TestDirectory", "/Test/Data/", $False, $transferoptions)


However, the transfers still seem to run at max bandwidth. I am assuming I have an incorrect syntax on the synchronization line, but the script does not throw any errors. Can you assist with an example of adding TransferOptions to the SynchronizeDirectories method, please?

I appreciate any guidance.