From:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
} |
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: “ + $fileif (!(test-path $file)){(New-Object System.Net.WebClient).DownloadFile($url, $file)}}
This is a great example of using powershell with the ,net framework.