我使用此示例我從這裏後得到了嘗試,如: 我使用PowerShell 2.0錯誤:Web客戶端請求(FTP)期間出現的異常 - PowerShell 2.0中
$File = "D:\28.csv"
$ftp = "ftp://username:[email protected]/in/28.csv"
"ftp url: $ftp"
$webclient = New-Object System.Net.WebClient
$uri = New-Object System.Uri($ftp)
"Uploading $File..."
$webclient.UploadFile($uri,$File)
我想將文件上傳到FTP服務器 但我不斷收到錯誤:
Exception calling "UploadFile" with "2" argument(s): "An exception occurred during a WebClient request."
At D:\Scripts\test.ps1:14 char:22
+ $webclient.UploadFile <<<< ($uri,$File)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
我捕獲錯誤及其sayong 「的請求的FTP命令是使用HTTP代理時,機器人的支持」。 任何想法? – naijacoder