$GetFileMaskString = "SLEXTRACT*.PGP; MCEXTR*.PGP" # Use the $transferoptions file mask property for the file mask $transferoptions.FileMask = $GetFileMaskString # Download the files according to the file mask stored in transferoptions $Session.GetFiles("$ServerPath", "$DLPATH", $false, $transferoptions).Check()
This does successfully download the files, but there is an empty directory above the files on the server, and when I use the file mask, this empty folder gets downloaded also. For example:
When the download is complete, I have successfully downloaded.
How can I prevent this empty folder from being downloaded as well?
WinSCP Version 5.1.4 (Build 3020) (OS 6.1.7601 Service Pack 1)
Windows Server 2008 R2 Enterprise
Using SFTP Protocol
.NET Assembly from Powershell