Monday, August 09, 2010

Powershell V2, with no enhancements, has a good deal of functionality to begin with; however more functionality can be added to it through 'Extensions' that use Powershell Modules, which enhance, and extend the base functionality. In Version 1 of Powershell to add more functionality you would have to write cmdlets, and Snap-ins, that were done by writing them in a compiled .Net language, and added them into the Powershell environment. In Version 2, Powershell modules can be written in Powershell script, and they can perform like compiled cmdlets( which are still possible for very custom enhancements). Modules, and their flexibility, make Powershell simpler to extend, and customize.

The use of powershell by IT professionals, Database Administrators, and Developers, has provided a great base for an active community of contributors to extend powershell, and to share scripts. There are some very good books that have been produced on how to use powershell and on using powershell with products that have embraced powershell for automation of their product(VMware is an example that is most familiar to people working in IT).

I wanted to call out a few Extensions from the community that provide a good base collection, I am hoping to dig into these and understand them better for myself as part of an effort to impove my abilities. Learning Powershell requires writing your own scripts, looking at others code,viewing videos, reading books, and blogs.

The Powershell Community Extensions (PSCX) were created during the version 1 timeframe, and have been reworked to be compliant with the version 2 approach of extension. These are extensions that I have built a reliance on - the use of Get-Clipboard and Out-Clipboard are essential parts of getting data in and out of a script for 'quick and dirty' script done 'on the fly'.

In my post on 'Powershell and SMO' I mentioned the SQL Server Powershell Extensions(SQLPSX). They show the ISE can be extended through modules. Studying these extensions can be very instructional in how to approach your own development efforts.

When Powershell v2 was 'officially' released with Windows 7 in October 2009, there was also a release of the 'Windows 7 Resource Kit' that included the PowershellPack, this has 800 scripts in 10 modules included. In particular the WPK - an extension that allows for creation of XAML interfaces from powershell script. These extensions allow for the development of a graphical-user-interface(GUI) for users who might not be comfortable with running scripts, and find point-and-click to be more to their liking. This is a good option if you don't want to have to use the Powershell SDK for this type of interface, and build it out with Visual Studio - the 'Visual Studio/Powershell SDK' option is very good when you want to lock down the profiles, and commandsets that can be done within the GUI. WPK is a way to present a simple interface that will help people.

One location for reviewing individual scripts that have been shared by the community would be PoshCode.org site.

The learning curve for powershell is steep, but worth doing - Powershell feels like the swiss army knife, that you can pulled out as the tool of choice to address problems quickly, and create good repeatable solutions. Learning from others is important and these should be good sources of more powershell information.

Monday, August 09, 2010 4:10:54 AM (Eastern Standard Time, UTC-05:00)