Windows PowerShell Cookbook review

Windows PowerShell Cookbook by Lee Holmes.  Published by O’Reilly ISBN0596528493

Lee Holmes is a developer on the PowerShell team and is renowned for his blog at  This book has quotes on the back cover from both Jeffrey Snover and Bruce Payette and in one respect I’m afraid I have to disagree with both of them.

Ha – bet that’s got your attention!!

The PowerShell Cookbook follows the format of other books in this series.  A set of short, very well explained answers (and in this case a script) to solve a particular problem.  The book comprises 26 chapters in four sections.  Part I covers a quick tour of PowerShell, what it is and what it looks like plus a few fundamental concepts.   Part II follows straight on covering how to use and configure your PowerShell environment, how to use the pipeline which is one of the most fundamental concepts in PowerShell and something that gives it much of its power.  This section continues with various language elements including looping and flow control, variables, strings, and maths.  Each of these sections is presented as a series of tasks – instant answers to the "How do I do….." questions.

Part III is where the book really kicks in with chapters covering working with files, the Internet, scripting, arrays, user interaction, tracing and error handling and security among other topics. 

The last third of the book covers using PowerShell with the file system, the registry, event logs, processes and services, Active Directory, Exchange 2007 and Operations Manager 2007. 

In all of these chapters a set of problems are defined and then the PowerShell script that solves the problem is listed and discussed.  The problems are all real world examples of the sorts of things that users of PowerShell will find themselves needing to do.  Obviously not every possible situation can be covered but the examples are such that the concepts explained in the scripts can be applied to solve other problems.

The book supplies scripting solutions to the problems – it does not assume that any of the PowerShell add ins or extensions are installed.

The last 80 pages of the book cover a set of Appendices that are absolutely invaluable.  I could make a case that the book is worth buying for the appendices alone!  They cover

  • PowerShell Language and environment – one of the best quick reference guides I’ve seen
  • Regular Expressions
  • PowerShell Automatic Variables
  • Standard PowerShell verbs – no reason not to get your scripts named correctly now
  • Selected .NET classes and their uses – invaluable for someone starting to branch into .NET use with PowerShell, helps to find what you need to use in the mass of information available
  • WMI reference
  • Selected COM objects and their uses
  • .NET string formatting – best explanation I’ve seen
  • .NET date time formatting

All in all this is a superb book and I would recommend it to anyone using PowerShell – newcomer or expert – you will find lots of useful information.  The expert user will be intrigued by some of the solutions – I know I found some ahhh – thats how that works type moments as I was reading.

Buy it. Read it.  Use it.

Oh you want to know my disagreement.  Both of those fine gentlemen said it should be on every PowerShell users book shelf.  I think it should be on your desk, open and in use.  Its the sort of book you keep turning back to – "Now how do I do that again………".  There that wasn’t so bad.

Superb book. And the script examples can be downloaded so you don’t need to type them in.

Technorati Tags:
About these ads
This entry was posted in Powershell. Bookmark the permalink.

3 Responses to Windows PowerShell Cookbook review

  1. Jeffrey says:

    Excellent point.  You are correct – the book should be on your desk.
    Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog at: the Windows PowerShell ScriptCenter at:

  2. Lee says:

    Thanks for the comments!

  3. Ted Strand says:

    I totaly agree!!  I have this book, and it is my primary reference for PowerShell.  I learn better by example and by solving problems that I need to reslove today.  I will admit that I like the format as I have several others in the series.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s