WinSCP使用PowerShell在我上传的SFTP站点上添加了一个目录。

问题描述 投票:0回答:1

我正在使用PowerShell脚本和WinSCP将一个文件上传到一个SFTP站点。Root\Users\SFTPSite 并将该目录放到我上传的SFTP站点上。所以,与其把它放在 Root\Users\SFTPSite 它的投入 Root\Users\SFTPSite\Outbound. 不知道是不是因为权限问题,让我无法将其放在 SFTPSite 目录,或者与SFTP站点的设置方式有关,或者其他原因,因为我在其他站点上使用同样的脚本没有问题。以下是我使用的参数

param (
    $localPath = "\\fileshare\ftp\ThirdParty\Outbound\",
    $remotePath = "/users/SFTPSite/"
)

这就是我的转移方式。

$transferResult = $session.PutFiles($localPath, $remotePath, $False, $transferOptions)

任何帮助将是非常感激的。- 谢谢。

powershell sftp winscp
1个回答
1
投票

是不是因为你在复制目录?

你是否尝试复制内容添加一个 * ?

 param (
     $localPath = "\\fileshare\ftp\ThirdParty\Outbound\*",
     $remotePath = "/users/SFTPSite/"
      )
© www.soinside.com 2019 - 2024. All rights reserved.