Too Intimidating ... need template!

Topics: Developer Forum
May 8, 2008 at 3:49 PM
Edited May 8, 2008 at 3:49 PM
So, I wrote ... Get-Web
It downloads files from the web ... and converts them to XML if that's appropriate ... or saves them as files.
I'd like to contribute it ... but I have two major problems:

  • I don't want to put it in the wrong place and even after months of downloading source and playing with it ... I'm still confused by all the inheritance you guys have set up -- I think we need some templates or something to make it easier for the community to contribute.
  • Although there is a project on CodePlex called the (Html Agility Pack) ... I used the SgmlReader which I've been using for years. It's an old MS Sample from GotDotNet and I don't know about the license (although I have the source) ... it seems to have been abandoned, and the only copy I can find on the web anymore is inside the OpenGarden project (and I know this wasn't GPL to start with). Does anyone know how to get in touch with Chris Lovett @ Microsoft? ( ) ... maybe I should just port it to the HtmlAgilityPack, but I have more interesting things to learn about than another SGML-to-XML converter.
May 10, 2008 at 4:31 AM

Interesting.  I have been planning for some time (trying to find the time) to create a set of cmdlets to use RESTful APIs.  I had considered something like:

GET: Get-HttpResource -Url (pos 0) -Head (optional switch to get header only) ... (proxy settings)
PUT: Set-HttpResource -Url (pos 0) -Content .. (bunch of other settings for cookies, headers and proxy)
POST/UPDATE: Add-HttpResource -Url (pos 0) (bunch of other settings for cookies, headers and proxy)
DELETE: Remove-HttpResource -Url (pos 0) (proxy settings)
OPTIONSL Get-HttpOptions -Url (pos 0) (proxy settings)

Would these be two different sets of cmdlets or can we make them the same?  As for location, I would say PscxSnapin\Commands\Web (need to create that folder).  As for complexity - I agree.  It has gotten so that it is hard to wrap you mind around (and debug).  I would suggest inheriting from PscxCmdlet and doing your own thing in the various overrides.  However I do think there should be a base class for these cmdlets that inherits from PscxCmdlet. This base class should be able to provide the common connection handling & proxy settings.