Skip to content

Instantly share code, notes, and snippets.

@rchaganti
Created May 28, 2014 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rchaganti/47bd453b04b65eff457f to your computer and use it in GitHub Desktop.
Save rchaganti/47bd453b04b65eff457f to your computer and use it in GitHub Desktop.
Download Podcasts and Channel9 feeds using PowerShell
$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
}
}
@marcelodeaguiar
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment