Sunday, September 23, 2007

Howto: Invoking cmdlets within a cmdlet using C# (part I: the intro)

As part of my involvement with the  PowerGadgets MVP program, I have seen users requesting a way to hide sensitive information.  They aren't looking for fool-proof methods, but something that at least hides plain text information like usernames, passwords and other sensitive information.

The Windows PowerShell SDK has some information on invoking cmdlets within a cmdlet.  I set out to figure out a way to create cmdlets that invoke other cmdlets using the SDK information.  I had some issues figuring out a few things, but with the help of Bruce Payette of the Windows PowerShell development team, I was able to find a working solution.

I'm going to use 2 cmdlets from PowerGadgets to show how this can be done.

I'm going to do this howto in 5 major parts.  First, I will do this with PowerGadgets' invoke-webservice cmdlet (and later do their invoke-sql cmdlet perhaps all in one post or over a few):

  1. Introduction (this message you're reading).
  2. When dealing with cmdlets that derive from the cmdlet class (using csc.exe).
  3. When dealing with cmdlets that *do not* derive from the cmdlet class (using csc.exe).
  4. When dealing with cmdlets that derive from the cmdlet class (using Visual Studio 2005 C# Express).
  5. When dealing with cmdlets that *do not* derive from the cmdlet class (using Visual Studio 2005 C# Express).

If there's any kind of demand for it, I could also shows how to do this via a screencast.

Thursday, September 13, 2007

PowerShell scripts contest (French)

The guys at PowerShell-Scripting (based in France I assume) are putting on a PowerShell scripting contest until the end of December.

Winners will be based on the total points that their scripts will get from other users.  The top 10 point scorers will win prizes such as their upcoming French PowerShell book and some other stuff.

French PowerShell book due early in 2008

Jeffrey Snover will be able to add another book to his multi-lingual selection soon enough.  I see the French guys at PowerShell-Scripting have announced a PowerShell book due out early in 2008.

New FTP automation add-on (COM)

Sapien is offering a free FTP automation library (COM interface) for automating FTP stuff from within scripting languages that have COM support.  I can't wait to try it with PowerShell!

I'm hoping to put on a few blog posts on this (if somebody else doesn't beat me to it).

RSSBus update

I've blogged about RSSBus before.  They recently released RC1 of their server and desktop versions.  Definitely worth checking out if you want to do cool things with RSS feeds.

Tuesday, September 11, 2007

New PowerGadgets build

PowerGadgets has just come out with build 1.0.2806 as of this morning.  The trial version available online is 1.0.2760.

Friday, September 7, 2007

I am a technical reviewer... part 2

I blogged in June that I was a technical reviewer for Sapien.  I just started doing a technical review of an upcoming book from Wrox.  I am under an NDA, so cannot say anything else at this time.