PowerShell $transferOptions.FileMask not working

Advertisement

bartplessers
Joined:
Posts:
1
Location:
Belgium, heverlee

PowerShell $transferOptions.FileMask not working

Hello,

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
$session.Open($sessionOptions)

$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
$synchronizationResult.Check()


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,
Bart

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum