Skip to content

Instantly share code, notes, and snippets.

@scowalt
Created October 29, 2016 17:02
Show Gist options
  • Save scowalt/c00b9dc31f705e101cc71367349baec9 to your computer and use it in GitHub Desktop.
Save scowalt/c00b9dc31f705e101cc71367349baec9 to your computer and use it in GitHub Desktop.
[Reflection.Assembly]::LoadWithPartialName( "System.IO.Compression.FileSystem" )
$urlPrefix = "http://www.pumpproplus.com/downloads/simfiles/pe00/pe"
$urlExtension = ".zip"
For ($songNumber = 0; $songNumber -lt 100; $songNumber++)
{
$formattedSongNumberString = "{0:D2}" -f $songNumber
$localFileName = $formattedSongNumberString + $urlExtension
$localFilePath = Join-Path $pwd $localFileName
$fullUrl = $urlPrefix + $formattedSongNumberString + $urlExtension
Invoke-WebRequest $fullUrl -OutFile $localFileName
[System.IO.Compression.ZipFile]::ExtractToDirectory($localFilePath, $pwd)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment