Created
May 28, 2014 08:58
-
-
Save rchaganti/47bd453b04b65eff457f to your computer and use it in GitHub Desktop.
Download Podcasts and Channel9 feeds using PowerShell
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
$feed = "http://channel9.msdn.com/Shows/Azure-Friday/feed/mp4high" | |
$destination = "AzureFriday" | |
mkdir "~\Desktop\${destination}" | |
cd "~\Desktop\${destination}" | |
$a = ([xml](new-object net.webclient).downloadstring($feed)) | |
$a.rss.channel.item | foreach{ | |
$url = New-Object System.Uri($_.enclosure.url) | |
$file = $url.Segments[-1] | |
if (!(test-path $file)) | |
{ | |
Start-BitsTransfer -Source $url -Destination $file -Asynchronous | |
} | |
} | |
Start-Job { | |
While ((Get-BitsTransfer).JobState -contains 'Transferring') { | |
Get-BitsTransfer | Where-Object { $_.JobState -eq 'Transferred' } | Foreach { Complete-BitsTransfer -BitsJob $_ } | |
Start-Sleep 5 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My version with proxy support https://gist.github.com/marcelodeaguiar/857f35114b15f4015ff9