Exclude Mask not working
Using WINSCP powershell, I'm trying to download files from SFTP then delete the files from the SFTP source once the files are downloaded.
However, the exclude mask doesn't seem to work. I'm trying to exclude subfolders from the root using the following masks:
or
CSV files to be downloaded are on
I want to exclude the folder
However,
Snippet of the code:
However, the exclude mask doesn't seem to work. I'm trying to exclude subfolders from the root using the following masks:
"*.csv|*/"
or
"|*/"
CSV files to be downloaded are on
/testroot
.
I want to exclude the folder
/testroot/testarchive
and its contents from being downloaded.
However,
/testarchive
and its contents are still being downloaded.
Snippet of the code:
param ( $localPath = "C:\summit\FXGo\FileInput\", $remotePath = "/testroot/" ) $transferOptions = New-Object WinSCP.TransferOptions $transferOptions.FileMask = "*.csv|*/" $session = New-Object WinSCP.Session try { # Connect $session.Open($sessionOptions) $synchronizationResult = $session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Local, $localPath, $remotePath, $transferOptions)