Created
June 7, 2017 04:39
-
-
Save stopthatastronaut/0e8c9e0067b2048353fec3d6dc1575ac to your computer and use it in GitHub Desktop.
Download files from an array of URLs
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
# Here's our array of files | |
$files = @( | |
"https://download.octopusdeploy.com/octopus/Octopus.3.13.9-x64.msi", | |
"https://download.octopusdeploy.com/octopus/Octopus.Tentacle.3.13.9-x64.msi", | |
"https://download.octopusdeploy.com/octopus/Octopus.3.13.10-x64.msi", | |
"https://download.octopusdeploy.com/octopus/Octopus.Tentacle.3.13.10-x64.msi" | |
# etctera | |
) | |
# loop through the array, extract the filename using uri segments, download the file | |
$files | % { | |
$filename = ([uri]$_).segments | select -Last 1 | |
iwr $_ -OutFile $filename | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment