Question, does this process remove the file(s) it downloads on the remote side AND the directories? or should it only be the files? Using Powershell and Winscp 5.9 I noticed the $Session.Getfiles() method seems to attempt to delete the directory when you have the remove parameter set to $true.
Does this Method support using Transfer Options ie In the example I didn't see them being used so I'm curious.
$transferOptions = New-Object WinSCP.TransferOptions $transferOptions.FileMask = "*.pdf,*.txt|*.tmp,*.exe" $transferOptions.TransferMode = [Winscp.TransferMode]::Binary