Topic "transerOptions.FileMask does not work"

Author Message



I'm trying to sync my windows phone FTP server to localdisk.
I'm using PowerShell (windows 10)
and WinSCP-5.9.1-Automation

The main part of my script:

$session.add_FileTransferred( { FileTransferred($_) } )

# Connect

$transferoptions = New-Object WinSCP.TransferOptions
# $transferOptions.FileMask = "*>2016-O8-01"
$transferoptions.FileMask = ".txt"

# Synchronize files
$synchronizationResult = $session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Local, $FTPLocalFolder, $FTPRemoteFolder, $false, $transferoptions)

# Throw on any error

At the end, I only want to sync files where dateModified > 2016-08-01. This filemask didn't work, so I tried with FileMask = ".txt", but this didn't work either: all files are synchronized, no matter what the extension is.

What do I wrong?

Kind regards,
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26299
Location: Prague, Czechia
The TransferOptions is the 7th, not the 5th argument of the Session.SynchronizeDirectories:

Also, in the 2016-O8-01, you have a letter, not a digit.

You can post new topics in this forum

Search Site

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