Skip to content

Instantly share code, notes, and snippets.

@erichexter
Created November 2, 2012 20:59
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save erichexter/4004261 to your computer and use it in GitHub Desktop.
Save erichexter/4004261 to your computer and use it in GitHub Desktop.
Download build 2012 videos
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)
#Set the username for windows auth proxy
$rss.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials
$a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/Build/2012/RSS/wmvhigh"))
$a.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $_.creator + "-" + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-") + ".wmv"
if (!(test-path $file))
{
$wc = (New-Object System.Net.WebClient)
#Set the username for windows auth proxy
$wc.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials
$wc.DownloadFile($url, $file)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment