Unit testing Cmdlets for PowerShell

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.")

 

No Comments