PowerShell Synchronize mode 'Both' with Transfer Options
I am struggling to include
Here is a snippet of modified code based on the included 'KeepLocalUpToDate' extension.
$TransferOptions
when using Synchronize mode 'Both'. I looked through loads of documentation but just couldn't figure out how to make it work in powershell. Thanks for the support!
Here is a snippet of modified code based on the included 'KeepLocalUpToDate' extension.
Write-Host "Connecting..." $session.Open($sessionOptions) #Setup Transfer Options $transferOptions = New-Object WinSCP.TransferOptions $transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off $TransferOptions.FilePermissions = New-Object WinSCP.FilePermissions $TransferOptions.FilePermissions.Octal = 0777 while ($True) { Write-Host "Synchronizing changes..." $result = $session.SynchronizeDirectories( [WinSCP.SynchronizationMode]::Both, $localPath, $remotePath,[WinSCP.SynchronizationCriteria]:: $TransferOptions )