PowerShell Cookbook Now Available
Tuesday, 30 October 2007
Update 8/16/2010: The much expanded second edition is now available.
As just announced by O’Reilly, the PowerShell Cookbook is now available!
As your experience grows in any technology, you learn and benefit from the combination of two distinct types of knowledge:
- What can I do with the technology?
- How do I accomplish a specific task in that technology?
Question #1 focuses on the technology. You learn the answers to #1 from training, exploration, podcasts, and technology-specific books. This is where you immerse yourself in the looping constructs, variable syntax, etc. In PowerShell’s case, that’s (not surprisingly) turned out to be PowerShell in Action, along with the many other excellent PowerShell learning resources out there.
Question #2 focuses on the task. You know what you want to do, and the only think in your way is technology. You learn the answers to #2 from experience, and lots of it. Experience is in short supply when you first start working with a technology, so blog posts and internet searches often tentatively fill that void. Until the O’Reilly cookbook arrives, that is, at which point you have pre-canned solutions to many of your most vexing questions. In PowerShell’s case, we finally have a resource to fill that void – the PowerShell Cookbook.
The PowerShell Cookbook focuses squarely on showing you how to use PowerShell to get your job done. It builds on a huge base of distilled knowledge, and includes:
- Solutions to the most popular and searched-for TechNet / Script Center topics
- Scripts that address the most common community, newsgroup, and new user questions
- Scripts that wrap around and hide the complexity of advanced (but very useful) PowerShell scripting techniques
- Task-based introduction to all of PowerShell’s major features
In addition to all of this pre-distilled knowledge, the cookbook’s appendix provides a very thorough and complete PowerShell reference. Thorough enough to be a book all of its own, but now expanded and finally in a printed format. It includes:
- A complete reference to the PowerShell language and environment
- An exhaustive regular expression reference, along with PowerShell examples
- A complete listing of all PowerShell automatic variables
- A guide to PowerShell’s standard verbs, which helps you write scripts that match the PowerShell naming guidelines
- Hand-picked lists of the .NET classes, WMI classes, and COM objects most useful to system administrators
- An exhaustive String and DateTime formatting reference, along with PowerShell examples
Since the book focuses so strongly on the same crowd that frequents Microsoft ScriptCenter, I tapped Dean Tsaltas (one of the original Scripting Guys) for feedback and a forward. Perhaps my greatest disappointment about the book is that we didn’t have room for his fantastic cover quote. I would be remiss to relegate his unbiased opinion to the Cavern-Of-Thoughts-Unpublished, so I include it here:
“Must-read of the season! A stunning achievement! Tantalizing, witty, and entirely satisfying. Oh, wait — that’s the foreword.”
Dean Tsaltas, Scripting Guy emeritus, author of the Foreword.
So, enjoy the book — or at least the foreword :)


Subscribe to this blog.
No. 1 — November 8th, 2007 at 5:24 am
Your book is awesome! Mine arrived today and I’m reading it.
It’s definitely a MUST READ!
No. 2 — December 4th, 2007 at 11:52 pm
I’m enjoying your book a great deal. Thanks for your efforts!
Why the tortoise/turtle (i’ll look at it again when I get home for true animal name) for the colophon?
As one of my co-workers said – ‘that doesn’t exactly imply ‘power”
No. 3 — December 5th, 2007 at 3:51 am
Thanks!
It’s my understanding that turtles have "powerful shells" :)
Lee
No. 4 — December 17th, 2007 at 4:22 pm
Love it!
http://blogs.flaphead.dns2go.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts§ionid=6&postid=8894
No. 5 — August 25th, 2009 at 2:54 am
Hi Lee,
I started reading your book and stuck at one place, it would be really great if you could help me with it.
In recipe 1.13 you mentioned that I should copy the Get-AliasSuggestion.ps1 at some location so I copied it at C:\Users\manuj\Desktop\Powershell\Get-AliasSuggestion.ps1
Now at Powershell prompt I am trying to run the command ‘Get-AliasSuggestion’ but I get the following error. How to tell powershell that the codlet exist at path C:\Users\manuj\Desktop\Powershell
The term ‘Get-AliasSuggestion’ is not recognized as the name of a cmdlet, function, script file, or operable program. C
heck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:20
+ Get-AliasSuggestion <<<<
+ CategoryInfo : ObjectNotFound: (Get-AliasSuggestion:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
No. 6 — September 1st, 2009 at 4:06 am
Hi Manu;
Make sure the "PowerShell" directory is part of your path, and you should be good. There is discussion about that topic linked to from the end of the recipe ("Run tools, scripts, and existing programs.").