Created
November 25, 2022 08:26
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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