Unit testing Cmdlets for PowerShell

Published 26 October 06 03:59 PM | MikeD

I don't use PowerShell myself, but this blog post caught my eye.

If you miss VS, intellisense, TD.NET, etc., you might want to try extending PowerShell with custom cmdlets, which are .NET classes deriving from Cmdlet. They allow you to extend PowerShell while still programming in your favorite language.

Read Pablo Galiano's post for a step-by-step introduction to Cmdlets.

I'm hooked to PowerShell. It's been really fun to learn, and I'm loving it. 

I'm also hooked to Test Driven Design (that's what TDD should mean, IMO), so I naturally looked for a way to develop my cmdlets in a TDD way. Turns out that it's fairly easy.

As Joel would say, it makes me feel all warm and fuzzy when people take a "Test First" approach to something (and then he would say "...and the villagers dance.")

 

Comments

# PD said on October 27, 2006 10:25 AM:

Wait until you use Powergadgets, then you will reall be hooked to PowerShell.

There is a CR2 available for download at http://www.powergadgets.com/trial/

Cheers,

PD