Add to Technorati Favorites
Welcome to ThePowerShellGuy.com Sign in | Join | Help

Writing Custom Cmdlets for Windows PowerShell, and Hosting PowerShell

A great Primer to get you started with writing PowerShell Cmdlets : Writing Custom Cmdlets for Windows PowerShell, as step by step walktrough for creating a Get-Contact Cmdlet to retrieve contacts in outlook from PowerShell the Introduction from the Site :

 

Writing custom Cmdlets for Windows PowerShell

Article Overview

In this article we will take a look at how to write a custom cmdlet for Windows PowerShell, which is the new command shell from Microsoft (formerly called "Monad"). Our cmdlet named "Get-Contact" will have the ability to retrieve contacts defined in Outlook 2007.

The full source code, inlcuding unit tests, installations scripts etc. can be found here.

the Article is from September allready , but only found it today via Thomas Lee's Blog , as it is such a great resource, as Thoms did say Nice and thorough article!, and you might have missed it , if you did not check it out yet ...

and for a example about hosting PowerShell : PowerShell, as an extension method! , by Mitch Denny ( This one is from today ! ;-) )and again the full Source is Provided

PowerShell, as an Extension Method !  

I just put together a quick little example of how to host PowerShell inside your own application, but to make it more useful I built it as an extension method so that you can basically call ToPowerShell(…) on any object. If the object happens to implement IEnumerable then there is an alternative ToPowerShell(…) which allows you to specify whether to enumerate the items.

Download the sample if you are interested. 

Thanks guy's great work ! 

Enjoy,

Greetings /\/\o\/\/

Published Friday, December 28, 2007 5:28 PM by MoW

Comments

No Comments
Anonymous comments are disabled