• EnglishSpanishGermanFrenchPolishChinese (Traditional)


EnglishSpanishGermanFrenchPolishChinese (Traditional)

Operating systems, scripting, PowerShell and security

Operating systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Subir ficheros por FTP desde PowerShell

PowerShell
1
2
3
4
5
6
7
8
9
10
11
echo "hola" > prueba3.html
echo "hola" > prueba4.html
 
foreach($elemento in Get-ChildItem .)
{
    $elemento.FullName
    $ftp="ftp://pepito:[email protected]/$elemento"
    $webclient = New-Object System.Net.WebClient
    $uri = New-Object System.Uri($ftp)
    $webclient.UploadFile($uri, $elemento.FullName)
}

Publicado el día 14 de enero de 2021

CATEGORÍAS

PowerShell, Red

ETIQUETAS

.NET, Echo, foreach, FTP, Fullname, Get-ChildItem, HTML, Jesús Niño, Jesús Niño Camazón, New-Object, System.Net.WebClient, System.Uri, UploadFile, webclient

MÁS

  • Ejercicios de PowerShell: obtener información sobre el sistema operativo y enviarla por la red
  • Ejercicios de PowerShell: repaso del bucle foreach y de ficheros
  • Ejercicios de PowerShell: analizar ficheros DLL en todos los equipos de la red, comprobar que ha cambiado una integridad y copiar el fichero que ha cambiado
  • Instalación de servicios de transferencia de ficheros (Servicios en red)
  • Ejercicios de PowerShell: ejercicios sobre ficheros
  • Ejercicios de PowerShell: mostrar los ficheros que se han modificado de ayer a hoy