Today I downloaded the great ISESteroids add-in for the PowerShell ISE. While I was on their website, I noticed that they have a collection of free PDF “cookbooks” available.
I didn’t want to save each file down manually, and liked the thought of using a PowerShell script to download PowerShell documents from a PowerShell-related website. Here’s what I did to download them all:
$psPage = Invoke-WebRequest "http://www.powertheshell.com/cookbooks/" $urls = $psPage.ParsedHtml.getElementsByTagName("A") | ? {$_.href -like "*.pdf"} | Select-Object -ExpandProperty href $urls | ForEach-Object {Invoke-WebRequest -Uri $_ -OutFile ($_ | Split-Path -Leaf)}