Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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