网站建设和管理专业,服务器试用,可以免费做网站推广的平台,网上企业登记注册流程我在这个问题上一直在抨击我的大脑#xff0c;似乎无法修复它。我正在尝试使用PSFTP将文件上传到FTP。我正在使用的脚本#xff1a;#------------------------------------------------------#local variables$ftp_server SERVERNAME$ftp_path /FTPPATH/…我在这个问题上一直在抨击我的大脑似乎无法修复它。我正在尝试使用PSFTP将文件上传到FTP。我正在使用的脚本#------------------------------------------------------#local variables$ftp_server SERVERNAME$ftp_path /FTPPATH/PATH$local C:\ftp\$local_in Join-Path $local In$local_out Join-Path $local Out$session my_ftp_session# set up credentials object$username FFandP$password Get-Content $local_out\Credentials.txt | ConvertTo-SecureString -AsPlainText -Force$cred New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $passwordSet-FTPConnection -Server $ftp_server -Credentials $cred -Session $session -KeepAlive -confirm -UseBinaryGet-ChildItem -Path $local_out |% {$ftp_file $ftp_path/$($_.Name) # determine item fullnameAdd-FTPItem -Path $ftp_file -LocalPath $_.FullName -Session $session -}# -------------------------------------------------我收到错误Add-FTPItem : Exception calling GetResponse with 0 argument(s): The remote server returned an error: (550) Fileunavailable (e.g., file not found, no access).At line:22 char:1 Add-FTPItem -Path $ftp_file -LocalPath $_.FullName -Session $session ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Add-FTPItem我已尝试自行运行Add-FTPitem命令但我收到同样的错误。我可以使用FileZilla上传到FTP。我也尝试删除变量并使用硬编码路径;我得到了同样的错误。有什么想法吗