Posted on Updated on

Download File​

# Originally published at https://gist.github.com/nzthiago/5736907
# I took that script and added the PPTX pieces, and a few comments
# If you like it, leave me a comment
# If you don't like it, complain to Github. :)

[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)

# Grab the RSS feed for the MP4 downloads

# SharePoint Conference 2012 Videos
$a = ([xml]$rss.downloadstring(“http://channel9.msdn.com/Events/SharePoint-Conference/2012/RSS/mp4high”))

# Walk through each item in the feed
$a.rss.channel.item | foreach{
$code = $_.comments.split(“/”) | select -last 1

# Grab the URL for the MP4 file
$url = New-Object System.Uri($_.enclosure.url)

# Create the local file name for the MP4 download
$file = $code + “-” + $_.creator + “-” + $_.title.Replace(“:”, “-“).Replace(“?”, “”).Replace(“/”, “-“).Replace(“<“, “”) + “.mp4”

# Make sure the MP4 file doesn’t already exist
if (!(test-path $file))
# Echo out the file that’s being downloaded
$wc = (New-Object System.Net.WebClient)

# Download the MP4 file
$wc.DownloadFile($url, $file)




Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s