Powershell

 

For various reasons which may become apparent when you view my example feed, I needed to generate an RSS feed using PowerShell.  I was somewhat surprised to find that it had not been done before-at least not well.  There’s an example on the net having to do with Exchange, and it was helpful, but it was very specific to its task which was not my task.  So, I made a generalized script which can be reused for anything.

Usage:

   1: $feedItems = @(
   2:   @{
   3:     Title = 'feed item 1'
   4:     Link = 'http://halr9000.com/link/1'
   5:     Author = 'Hal Rottenberg'
   6:     Description = '<h1>Introduction</h1><p>This is can be a full blog post.</p>'
   7:     pubDate = get-date
   8:   }
   9:   # each hashtable is an item...
  10: }
  11: $feedItems | New-RssFeed -path 'c:\wwwroot\feed.rss' -title 'site title' -desc 'this is my site' -url 'http://halr9000.com'

 

Here’s an example: http://halr9000.com/test/feed.rss

Code:

: http://halr9000.com/article/636

2008-11-12 03:46:19

Absolutely Amazing, will the full code for VI events be in the book or can you add it here too ?

2008-11-12 07:25:02

Oh come on, I have to save some things for the book. :)

2008-11-12 07:29:36

Yet another reason to buy the book then :)

2008-11-12 11:03:57

Very nice!

2008-11-12 11:05:08

[...] http://halr9000.com/article/636 Published Wednesday, November 12, 2008 11:05 AM by rodtrent Filed under: RSS, Windows PowerShell [...]

Comments for this post will be closed on 10 February 2009.

  • Microblog

  • Recent Posts

  • Recent Comments

  • meta