1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$i=1 (Invoke-WebRequest "https://www.google.es/search?q=powershell&tbm=isch" | select -expand images | select -expand src) | %{ $name="imagen"+$i+".jpg" Start-BitsTransfer -Source $_ -Destination c:\powershell\$name $i++ $file="c:\powershell\$name" $webclient = New-Object System.Net.WebClient $uri = New-Object System.Uri($ftp) $webclient.UploadFile($uri, $file) } |