Topic ".NET and FileMask"

Author Message
CitrixITM
[View user's profile]

Joined: 2016-05-11
Posts: 1
Location: Fort Lauderdale, FL
Hi,

First, thank you so much for an amazing piece of software. Much appreciated.

I have a PowerShell script that leverages the WinSCP .NET assembly and works well.
I am Synchronizing the local files to match the FTP files.

I would like to update the script to sync only a single file in the remote directory. I'm trying to use the below Transfer Option to do this, but no matter what i try in there, I can't get any mask to work. Likely my syntax is off. I looked everywhere for an example that used .NET and filemask and was unable to find one.

$transferOptions.FileMask = "This is a file.csv"


Thanks so much!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
The code looks good.

Just make sure you actually pass the $transferOptions to the 7th argument of the Session.SynchronizeDirectories:
https://winscp.net/eng/docs/library_session_synchronizedirectories

If this does not help, show us your complete code and attach a session log file.
Advertisements

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License