With the new year well and truly underway, it's time to go over all those RSS feeds you're subscribed to, and clean out the ones that don't get updated any more.

But how? How could you possibly know which feeds haven't been posted to in the past, say, four months?

Why - with Windows PowerShell, of course! With a little help from the PowerShell Community Extensions and its awesome Common Feed Store provider!

So here's the command:

gci feed:\ -rec | ?{ $_.Type -eq "Feed" } | %{ $_.Items | sort -desc PubDate | select -first 1 } | ?{ $_.PubDate -lt [DateTime]::Now.AddMonths(-4)} | select @{Name="Feed"; Expression={$_.Parent.Name}}, PubDate | ft -au 

... and here's the result on my home PC:

Feed PubDate ---- ------- DataWorks WebLog 12/07/2006 7:57:00 AM Smart Client Data 9/08/2006 8:10:00 PM What's in Store 27/06/2006 1:26:00 PM Mick's Mix 21/08/2006 9:07:00 PM Microsoft at Home 20/06/2006 6:00:00 PM Microsoft at Work 9/05/2006 6:00:00 PM Xbox World Australia 30/12/1899 12:00:00 AM DVD Plaza 30/12/1899 12:00:00 AM Luke Hutteman 9/01/2006 5:12:37 AM Microsoft at Home 20/06/2006 6:00:00 PM Microsoft at Work 9/05/2006 6:00:00 PM 

Notice that a couple of those feeds have a date in 1899. That means that they don't provide a date against their posts, so they can be ignored - might as well keep hold of 'em. The rest can go! Ah ... a fresh start. :)