An Unexpected Side-Effect of Invoke-WebRequest
Recently I was working on a bit of PowerShell to download the awesome First Responder Kit from Brent Ozar Unlimited. The canonical URL for the FRK is http://firstresponderkit.org/
but that’s a redirect to the GitHub repository where all the magic happens. I thought to myself:
Self! Rather than take a chance on that GitHub URL changing, use the “main” URL and
Invoke-WebRequest
will take care of the redirect for you.
So off to the PowerShell prompt I went and ran Invoke-WebRequest -Uri http://firstresponderkit.org/
to start looking at the object returned so I could see what I needed to parse out to find my way to the true download URL.