Here is the code, the file mask is not working - all files are being put on the ftp:
$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
# Disconnect, clean up