Book Review: "Windows PowerShell Pocket Reference"
This is my review of "Windows PowerShell Pocket Reference" by Lee Holmes. It's a cheap book, I picked it up for $13 at Barnes and Noble, but it's even cheaper on Amazon for ~$8. It's also a quick read, with around 180 pages, cover to cover, you can read it through for a better understanding of PowerShell or you can keep it as a small desk reference for your own scripts. Essentially, It's a fundamentals book, focusing on the basic features of the language, such as data types, built in functions (such as utilizing the .NET framework), and lots of expression logic. It's a great book for having on hand as a reference if you are writing PowerShell scripts and hit a tricky logical situation, however it's not applied like Black Hat Python and it's not a cookbook or cheatsheet book similar to RTFM. Due to the lack of applied focus, I recommend this book for those looking to become better with PowerShell fundamentals, either writing or modifying custom scripts, as well as those who want to become more effective with Windows, as opposed to specifically penetration testers or even security engineers. That said, I'm giving this book 5 out of 10 stars for it's price, compact format, content, and usefulness as a reference text while scripting, but I would appreciate more of an applied administrative focus (like Part IV of Windows PowerShell CookBook, that I believe this reference is based on). The following is the table of contents, so you know can get a solid understanding of the fundamental, yet PowerShell specific, concepts this book covers:
Chapter 1: PowerShell Language and Environment
Commands and Expressions
Comments
Help Comments
Variables
Booleans
Strings
Numbers
Arrays and Lists
Hashtables (Associative Arrays)
XML
Simple Operators
Comparison Operators
Conditional Statements
Looping Statements
Working with the .NET Framework
Writing Scripts, Reusing Functionality
Managing Errors
Formatting Output
Capturing Output
Common Customization Points
Chapter 2: Regular Expression Reference
Chapter 3: XPath Quick Reference
Chapter 4: .NET String Formatting
String Formatting Syntax
Standard Numeric Format Strings
Custom Numeric Format Strings
Chapter 5: .NET DateTime Formatting
Custom DateTime Format Strings
Chapter 6: Selected .NET Classes and Their Uses
Chapter 7: WMI Reference
Chapter 8: Selected COM Objects and Their Uses
Chapter 9: Selected Events and Their Uses
Chapter 10: Standard PowerShell Verbs
The first 80+ pages are devoted to the first chapter, however my favorite chapters are 6-10, covering .NET, WMI, COM objects, Windows events, and Powershell commands, pages 109-151. Like I always say, it's all about the code, and while O'Reilly doesn't publish any of this books code online, it does publish the code from the Windows PowerShell CookBook, that this book is based on. While this book isn't security focused, I got into PowerShell through several security frameworks, which I am highly recommending for those into PowerShell and information security: PowerSploit, PoshSec, Nishang, Veil's PowerTools, and even the Github PowerShell group. I've also started my own repository, similar to my SPSE repo, with a focus on PowerShell template code and security scripts, called PSSE.
Chapter 1: PowerShell Language and Environment
Commands and Expressions
Comments
Help Comments
Variables
Booleans
Strings
Numbers
Arrays and Lists
Hashtables (Associative Arrays)
XML
Simple Operators
Comparison Operators
Conditional Statements
Looping Statements
Working with the .NET Framework
Writing Scripts, Reusing Functionality
Managing Errors
Formatting Output
Capturing Output
Common Customization Points
Chapter 2: Regular Expression Reference
Chapter 3: XPath Quick Reference
Chapter 4: .NET String Formatting
String Formatting Syntax
Standard Numeric Format Strings
Custom Numeric Format Strings
Chapter 5: .NET DateTime Formatting
Custom DateTime Format Strings
Chapter 6: Selected .NET Classes and Their Uses
Chapter 7: WMI Reference
Chapter 8: Selected COM Objects and Their Uses
Chapter 9: Selected Events and Their Uses
Chapter 10: Standard PowerShell Verbs
The first 80+ pages are devoted to the first chapter, however my favorite chapters are 6-10, covering .NET, WMI, COM objects, Windows events, and Powershell commands, pages 109-151. Like I always say, it's all about the code, and while O'Reilly doesn't publish any of this books code online, it does publish the code from the Windows PowerShell CookBook, that this book is based on. While this book isn't security focused, I got into PowerShell through several security frameworks, which I am highly recommending for those into PowerShell and information security: PowerSploit, PoshSec, Nishang, Veil's PowerTools, and even the Github PowerShell group. I've also started my own repository, similar to my SPSE repo, with a focus on PowerShell template code and security scripts, called PSSE.