PowerShell, RSS Feeds and MSDN Blogs
I noticed this morning that a bunch of my RSS subscriptions weren’t updating. Closer inspection revealed that they were predominantly from http://blogs.msdn.com, and their URL ended with “rss.aspx”. When I visited a couple of the blogs in question, I noticed that their RSS links had changed to “rss.xml”. I’m not sure if this is a recent thing (perhaps MSDN upgraded their blogging software) but I did know that it was going to be tiresome to unsubscribe each of those feeds and resubscribe in Internet Explorer.
PowerShell to the rescue!
Using the Common FeedStore provider which I wrote (and you can get it as part of the PowerShell Community Extensions on CodePlex), I was able to find and fix all of the offending feeds with one command! Behold!
dir feed:\ -rec | ? {$_.Type -eq "feed" -and $_.Url.StartsWith("http://blogs.msdn.com") -and $_.Url.EndsWith(".aspx") } | % {$_.Url = $_.Url.Replace(".aspx", ".xml") }
So … I’m getting (recursively) all the feeds in my “feed:” drive (that is, all the feeds I’m subscribed to) whose URL starts with the MSDN blogs address and ends with “.aspx”, and then replacing the “.aspx” with “.xml” in each feed.
Problem solved! Thanks, PowerShell!