Exclude File in SynchronizationMode

Advertisement

Jahn_Hlsi
Joined:
Posts:
2
Location:
Switzerland

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)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,074
Location:
Prague, Czechia

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)

Reply with quote

Advertisement

You can post new topics in this forum