Skip to content

Instantly share code, notes, and snippets.

@mvark
Created November 25, 2022 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvark/1c1796dd1352ba8b8feb046e74dd7c1d to your computer and use it in GitHub Desktop.
Save mvark/1c1796dd1352ba8b8feb046e74dd7c1d to your computer and use it in GitHub Desktop.
PowerShell script to download a list of files that have a predictable number pattern
# PowerShell script to download a list of files that have a predictable number pattern 1.jpg, 2.jpg etc..
$baseUri = "https://somesite.com/files/"
for ($i = 1; $i -lt 9; $i++) {
{
$f = $baseUri + $i + ".jpg"
$Downloadpath = "C:\temp\" + $i + ".jpg"
Write-Output "Processing file: $f"
Invoke-WebRequest -Uri $f -Outfile $Downloadpath
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment