Scott H’s RSS download script

From:

Here is a script that can grab items from a rss feed:
mkdir “~\Desktop\AzureFriday”
cd “~\Desktop\AzureFriday”
[Environment]::CurrentDirectory=(Get-Location PSProvider FileSystem).ProviderPath
$a = ([xml](new-object net.webclient).downloadstring(http://channel9.msdn.com/Shows/Azure-Friday/feed/mp4high”))
$a.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $url.Segments[1]
“Downloading: “ + $file
if (!(test-path $file))
{
(New-Object System.Net.WebClient).DownloadFile($url, $file)
}
}
This is a great example of using powershell with the ,net framework.

Leave a Reply

Fill in your details below or click an icon to log in:

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