PowerShell-Ftp-upload

$infographie="C:\Archive\Infographie\28052013\myfile.pdf"

$ftp = "ftp://174.9.102.210/public_html/infographie/myfile.pdf"

$user = "****"

$pass = "*******"

$webclient = New-Object System.Net.WebClient 

$webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)  

$uri = New-Object System.Uri($ftp)

try{

$webclient.UploadFile($uri, $infographie) 

}
catch
{

Write-Host "`nAn Error occured while uploading file to: $Uri"

Throw    
}

Problem habe ich jedes mal, wenn ich versuche das script ausführen, habe ich versucht, viele Lösungen, aber keine davon mein problem gelöst

Exception calling "UploadFile" with "2" argument(s): "An exception occurred during
a ebClient request."
At D:\Scripts\test.ps1:14 char:22
+ $webclient.UploadFile <<<< ($uri,$File)
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException

Wenn ich mit filezila es scheint, die Verwendung von Proxy-ixftp.e-ich.net:8011 und es funktioniert, ich weiß nicht, wie Sie zum einrichten des proxy in der PowerShell

InformationsquelleAutor user2431419 | 2013-05-29

Schreibe einen Kommentar