Topic ".NET and FileMask"

Author Message
[View user's profile]

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

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!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
The code looks good.

Just make sure you actually pass the $transferOptions to the 7th argument of the Session.SynchronizeDirectories:

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

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