Download all the videos from Build 2015
Build 2015 was epic, there was so much content so Microsoft even recorded some content before build (now available at Channel9).
I usually download everything to my laptop and watch it to and from work, this script will download all videos from Build 2015 =)
This is an updated version of my script I previously blogged about here.
cd "d:\build15"
$pattern = "[{0},\:,\']" -f ([Regex]::Escape([String][System.IO.Path]::GetInvalidPathChars()))
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$a = ([xml](new-object net.webclient).downloadstring("http://s.ch9.ms/Events/Build/2015/RSS/mp4high"))
$a.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = [Regex]::Replace($_.Title + " " + $url.Segments[-1] , $pattern, ' ')
Write-host ("{0} - {1}" -f "Downloadning" ,$file)
if (!(test-path $file))
{
(New-Object System.Net.WebClient).DownloadFile($url, $file)
}
}
Just copy the code, paste it into a file called “Build2015.ps1”, create a directory (in my case “c:\Build15”) and change the path in the first line of the script.
Right click on the file and choose run with PowerShell.
In case you get a problem similar like “Build2015.ps1 cannot be loaded because running scripts is disabled on this system.”
Start PowerShell as an administrator and run “set-executionpolicy unrestricted”, this is probably a bad thing to do for security.