I am using the .NET assembly of WinSCP 5.13.1 (Build 8265) from PowerShell on Windows 10.
I have followed the good and detailed descriptions in the WinSCP web site for using the assembly in PowerShell. But unfortunately, the "DuplicateFile" method is generating an exception, when I try to call it. More specifically, I get the following error message:
Exception calling "DuplicateFile" with "2" argument(s): "Operation not supported."
I specified a session log file in my script, from where I see a similar entry:
> 2018-05-16 15:47:29.008 Script: cp "/remote/folder1/File2.txt" "/remote/folder1/Backup/"
< 2018-05-16 15:47:29.011 Script: Operation not supported.
I have no problems downloading the file, then uploading it to the destination folder. But I would really like to avoid this.
For the record, I also have no problem using the "MoveFile" method on the same file and folders.
Neilsean Lavlund Victorino