Friday, February 2, 2007

PSCX: Playing with IE7 RSS features

One you have PSCX installed, you have access to all of the RSS features within IE via the "feedstoreprovider".  For example, here's a quick copy and paste from my current session:

76> cd feed:
77> ls

Type Name
---- ----
folder PowerGadgets
feed $cript Fanatics


I've cutoff most of the output to properly add it here.

I like to visually see what goodies are out there to read, so with the help of mabster who developed the feature, I've taken his script and made some slight edits.



gci feed:\ -rec |
? {$_.Type -eq "Feed"} |
% {
  if($_.LastDownloadError -eq 0){
    if($_.UnreadItemCount -gt 0){
      write-host -foregroundcolor green -noNewLine $_.Name;
      write-host -foregroundcolor green ("`t(" + $_.UnreadItemCount + ")")
  else {
    write-host -foregroundcolor red -noNewLine $_.Name;
    write-host -foregroundcolor red ("`t(" + "Download failed" + ")")


[end of all_feeds.ps1]

My example output is all kind of Christmas-y, but I haven't played with Windows Live Writer enough to get the colors right here for now:

81> .\all_feeds.ps1
You Had Me At EHLO... (1)
Bob Beauchemin's Blog (Download failed)
Slashdot (2)
Precision Computing (Download failed)

So, I get the number of unread items, and a nicer error if the download of the RSS feed fails (I could put the actual code, but an error simply identified as "1" means nothing to me).  Previously to setting $ErrorActionPreference, the error on the screen was annoying.