Created
January 23, 2018 06:28
-
-
Save danielewood/6831343555ef06b4fa6bdcf13eb4ee60 to your computer and use it in GitHub Desktop.
This file contains 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
$links=' | |
' | |
$results=@(); foreach ($link in $links.Split("`r`n")){ | |
$results+= $link | |
} | |
$results=$results | sort -u | |
foreach ($result in $results){ | |
$request = [System.Net.WebRequest]::Create($result) | |
$request.AllowAutoRedirect=$false | |
$response = $request.GetResponse() | |
Invoke-WebRequest "$result" -Outfile $([System.IO.Path]::GetFileName($($response.GetResponseHeader("Content-Disposition").Split('=')[1]))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment