Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Please ignore this topic!

Please ignore this topic...

I found out the issue. I was executing $session.FileExists($source) prior to calling the GetFiles function. The FileExists() method doesn't return true if the source contains files but path is a wildcard (ie. "folder/*"). As a result I removed the FileExists() method.

Thanks again,


Unable to download ALL files from a given folder

I hope you can help.

I am using .NET script for WinSCP v5.15.19.

I am trying to download ALL files from the '/home/folder/' folder on an SFTP Server.

I want to download all the files and delete them once they have downloaded. As a result I am using the following command...

$session.GetFiles('/home/folder/*', 'C:\LocalFolder\', $true, $transferOptions)

I would expect this to download all the files in the folder and then delete all the files it has successfully downloaded.

I have tried the following:
$session.GetFiles('/home/folder/', 'C:\LocalFolder\', $true, $transferOptions)

This 'kind of' works (ie. it downloads all my files), but it deletes the "FPS" folder - which I don't want to do.

Am I doing anything wrong?

Many thanks,