Friday, June 14, 2013

PowerShell Mass Download

Here is an example of a PowerShell script to mass download files from a web site. This is a very simple example and would probably need to be changed based on your need. The files I wanted to grab were named 1000.jpg.  A four digit number jpg.


$storageDir = "C:somefolder"
$webclient = New-Object System.Net.WebClient
$i = 1050
do {
$url = "https://yourwebsite.com/path_to_the_files/$i.jpg"
$file = "$storageDir$i.jpg"
$webclient.DownloadFile($url,$file)
$i++

while ($i -le 2000)

Good luck