.NET assembly TransferOption to limit speed of transfers

Advertisement

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.

Reply with quote

Advertisement

You can post new topics in this forum