WinSCP .net assembly file mask not working
Here is the code, the file mask is not working - all files are being put on the ftp:
try
{
# Connect
$session.Open($sessionOptions)
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$transferOptions.FileMask = ".txt"
# Sync files local and delete any that are not on the SFTP
$synchronizationResult = $session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Remote, $SourcePath, $FtpPath, $True, $False, [WinSCP.SynchronizationCriteria]::Time, $transferOptions)
# Throw on any error
$synchronizationResult.Check()
}
finally
{
# Disconnect, clean up
$session.Dispose()
}