-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Description
Hello,
When moving an item between folder if the file name already exist in the destination we get an error.
[DBG]: PS C:\SCRIPT>> Move-SFTPItem -SessionId $SSHSesstion.SessionId -Path "./$($_.Name)" -Destination "./PDF/$($_.Name)"
Exception calling "MoveTo" with "1" argument(s): "Failed to rename file/home/abc@null.null_UUID_106_5/fakt_20231029_50014114.p.202954.pdf M: Error during remote request handle."
At C:\Program Files\WindowsPowerShell\Modules\Posh-SSH\3.1.1\Posh-SSH.psm1:1393 char:17
+ $itemInfo.MoveTo($Destination)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SftpPathNotFoundException
Having a -Force option which would allow to automatically replace the file in the destination would be a great addition.
Chris
Metadata
Metadata
Assignees
Labels
No labels