A number of people have mentioned to me that they didn't realize that Powershell is included by default in Windows 7. If you haven't yet jumped on the Powershell bandwagon, this is a good time. Powershell 2 includes a bunch of cool features like remoting (kind of like SSH) as well as a visual IDE for writing, editing and interactively debugging Powershell scripts.
Powershell great for system administration, but I mostly use it for quick and dirty "portable" apps that I don't feel like writing C#/VB for. Plus, I'm using .NET anyway, so it's all the same.
I wanted to download all my podcasts with Powershell, so I wrote this quick script in about 5 minutes. Other improvements I (or preferably you) could make to it could be: check the file size against the enclosure and re-download partials, rename the files to included a version of the title, include a progress bar.
Here's what I came up with. Perhaps you'll find it useful if you're not an iTunes/Zune person:
cd "C:\users\scottha\desktop\Hanselminutes Complete Download"[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath$a = ([xml](new-object net.webclient).downloadstring("http://feeds.feedburner.com/HanselminutesCompleteMP3"))$a.rss.channel.item | foreach{ $url = New-Object System.Uri($_.enclosure.url) $file = $url.Segments[-1] $file if (!(test-path $file)) { (New-Object System.Net.WebClient).DownloadFile($url, $file) }}
Of course you'll want to change the first line and the RSS Feed URL as you like.
If you've never used Powershell before, note that it's locked down from running scripts be default. You'll need to run it as Administrator once and run
Set-ExecutionPolicy unrestricted
This opens it up to run scripts, but it's not only VBS, the scripts won't run if you double-click them. You need to run powershell then type the name of your script to run it:
.\myscript.ps1
You can always set the execution policy back if it bothers you.
Hope this primitive mass podcast enclosure downloader is useful.
Scott Hanselman's Productivity Tips Video
Scott at DevReach in Bulgaria in October
Developer Stand up Comedy - Coding 4 Fun
TechDays/DevDays Netherlands and Belgium:
Posts by Category Posts by Month
Greatest Hits Dev Tools List