Posted: 2013-12-04 15:06
I am using the following few lines in my Powershell script to retreive files according to a file mask.
$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
Location: Prague, Czechia
There is no way to exclude empty folders from transfer.
You can post new topics in this forum
And it's free!