Download Files via PowerShell

The Invoke-WebRequest is used as weget method on Linux and the script below can get a serie of files on our web server and write to our local disk.

for($i=1; $i -le 10; $i++) {
    for($j = 1; $j -le 5; $j++) {
        $strFileName="File_" + $i.ToString() + "_"+ $j.ToString() + ".jpg"

        Invoke-WebRequest http://exemplo.com/$strFileName -OutFile c:\Temp\$strFileName 

    }
}

Read More