Download file the Powershell way

I was building a lab in Azure today and needed to download the Exchange binaries to extend my test AD schema.

When you open up IE and browse to the Microsoft download site you have to add a list of 10 or 15 different sites to trusted - some of them are CDNs for shared Javascript code and resources. Content from the website listed below is being blocked by the Internet Explorer Enhanced Security Configuration https://assets.onestore.ms

https://cdn.optimizely.com
https://c.s-microsoft.com
https://query.prod.cms.rt.microsoft.com
https://mem.gfx.ms

and then… Your current security settings do not allow this file to be downloaded sigh!

Now, I know how to fix this problem properly, but frankly, that is a lot of clicking. Normally I would go and install another browser that isn’t weighed down by years of poor security practice… but.. today I decided to find the PowerShell way.

Start-BitsTransfer -Source https://download.microsoft.com/download/7/4/9/74981C3B-0D3C-4068-8272-22358F78305F/Exchange2013-x64-cu13.exe -Destination d:\Exchange2013-x64-cu13.exe

I just attempt to download the file on my machine, and then copy the link and tada! Now I can include this step in my powershell build scripts too! Awesome!