Good morning,
I'm trying to upload files to an FTP with PowerShell but it gives me an error, if you can bring some light I would appreciate it very much.
$ftp = "ftp://192.168.0.2/"
$user = "user"
$pass = "pass"
$webclient = New-Object System.Net.WebClient
$webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
$item="C:/Pruebas/origen/prueba.txt"
$uri = New-Object System.Uri($ftp+$item.Name)
$webclient.UploadFile($uri, $item.FullName)
Excepción al llamar a "UploadFile" con los argumentos "2": "Excepción durante una solicitud WebClient."
En línea: 8 Carácter: 1
+ $webclient.UploadFile($uri, $item.FullName)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
Any ideas?
Thank you.