Post a reply

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)


Topic review


Re: Exclude File in SynchronizationMode

The Session.SynchronizeDirectories takes TransferOptions as its 7th parameter:

$synchronizationResult = $session.SynchronizeDirectories(

    [WinSCP.SynchronizationMode]::Local, $localPath, $remotePath, $False, $False, [WinSCP.SynchronizationCriteria]::Time, $transferOptions)

Exclude File in SynchronizationMode

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)