Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Last active May 27, 2018 22:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save guitarrapc/60851d0a301a79f89757a59ef02c9778 to your computer and use it in GitHub Desktop.
PowerShellっぽく陸上自衛隊のイラク派遣日報をまとめてダウンロードしてみる (同期処理)
(Invoke-WebRequest -Uri https://www.asahi.com/articles/ASL4J669JL4JUEHF016.html).Links.href | Where {$_.EndsWith(".pdf")} | Sort-Object -Unique -PipelineVariable pdf | ForEach{ Start-Job {param($uri,$file,$path) cd $path; Invoke-WebRequest -Uri $uri -OutFile $file} -ArgumentList $pdf,$pdf.Split("ichikijiatesi/").Replace("/","_")[1]),$pwd}
(Invoke-WebRequest -Uri https://www.asahi.com/articles/ASL4J669JL4JUEHF016.html).Links.href | Where {$_.EndsWith(".pdf")} | Sort-Object -Unique | ForEach {Invoke-WebRequest -Uri $_ -OutFile ($_.Split("ichikijiatesi/").Replace("/","_"))[1]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment