I have develop 2 scripts with WinSCP and powershell to synchronize 2 file servers,
The first to synchronize and the second to check.
Unfortunately, i need to run the first script several time to ensure all files are correctly replicated.
For Synchronization, i have mapped the share drive and Synchronize directories using the following options
session.timeout="1:0:0" sessionOptions.Protocol = [WinSCP.Protocol]::Sftp sessionOptions.AddRawSettings("Utf","1") transferOptions.TransferMode = [WinSCP.TransferMode]::Binary transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off session.SynchronizeDirectories( [WinSCP.SynchronizationMode]::Remote, source, destination, True False [WinSCP.SynchronizationCriteria]::Eitherm transferOptions)
For checking, i have used ListDirectory on both file server with the following options and compare the results.
sessionOptions.Protocol = [WinSCP.Protocol]::Sftp sessionOptions.AddRawSettings("Utf","1") session.timeout="0:5:0" session.ListDirectory(path)
The first script take around 30 mns but the second around 3 hours.
For both scripts, i used WinSCPnet 220.127.116.11 (18.104.22.16874) and WinSCP 22.214.171.124 (126.96.36.19974)
Could you please help me to solve this issue.