Topic "Exclude File in SynchronizationMode"

Author Message
[View user's profile]

Joined: 2015-06-14
Posts: 2
Location: Switzerland
Dear All

I have problem with the file Name Thumbs.db in my Scripts,
In my script witch I use the $session.PutFiles option I have added the line $transferOptions.FileMask ="|Thumbs.db" and this had solved my problem,
but I would also exclude Thumbs.db in my other script in witch I use the WinSCP.SynchronizationMode option
and have only found in other post the session exclude option for the SynchronizationMode, but I am a beginner and would ask you how can I insert this option in my script

# Synchronize files to local directory, collect results
$synchronizationResult = $session.SynchronizeDirectories(
[WinSCP.SynchronizationMode]::Local, $localPath, $remotePath, $False)
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26447
Location: Prague, Czechia
The Session.SynchronizeDirectories takes TransferOptions as its 7th parameter:

$synchronizationResult = $session.SynchronizeDirectories(
    [WinSCP.SynchronizationMode]::Local, $localPath, $remotePath, $False, $False, [WinSCP.SynchronizationCriteria]::Time, $transferOptions)

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License