Skip to content

Instantly share code, notes, and snippets.

@mvark
Last active August 29, 2015 13:57
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/9659595 to your computer and use it in GitHub Desktop.
Save mvark/9659595 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
for ($i=1; $i -le 10; $i++)
{
$startTime = (Get-Date)
# Download files that have the naming format File1.txt, File2.txt etc..
(new-object System.Net.WebClient).DownloadFile("http://example/file$i.txt","C:\temp\file$i.txt")
$endTime = (Get-Date)
# Echo Time taken
"Time taken to download file$i : $(($endTime-$startTime).totalseconds) seconds"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment