The PowerShell Scripting and Toolmaking Book
The PowerShell Scripting and Toolmaking Book
$50.00
Minimum
$60.00
Suggested
The PowerShell Scripting and Toolmaking Book

This book is 100% complete

Completed on 2018-09-20

About the Book

Change the Way You Code in PowerShell!

Microsoft MVP Award recipients Don Jones and Jeffery Hicks bring you an all-new, "Agile-published" book on PowerShell Scripting and "Toolmaking." Written in their inimitable, approachable style with plenty of examples, this book focuses on an all-new narrative based on their teaching experiences since 2010. You'll not only learn "how to script" in PowerShell, you'll learn the far more important patterns and practices that will enable you to create reusable tools that look and work like native PowerShell commands. You'll also learn a world of related topics, including how to add database access to your tools, how to publish to public and private repositories, and even an introduction to key topics like Pester testing.

Thousands of IT professionals have, after experiencing Don & Jeff's classes and books, remarked that, "now I need to go home and rewrite everything I've done!" That's what this book will do for you: change the way you think about coding in PowerShell. You'll find yourself producing more efficient, more reusable tools, more easily and more quickly. You'll cement a deep understanding of not only how PowerShell works, but why it works that way, helping you make better script design decisions, and helping you execute better PowerShell tools from now on.

This book is very much "Part 3" in Don and Jeff's approach to teaching PowerShell. Part 1 is their bestselling Learn Windows PowerShell in a Month of Lunches (Manning), the "pre-scripting" PowerShell book that covers the shell's inner workings, core patterns, and basic usage. Part 2 is PowerShell Scripting in a Month of Lunches, which covers the entry-level aspects of scripting, including the foundational narrative of "the right way" to build functions and tools. This book picks up where they leave off, providing a rapid rundown of that "right way," and quickly moving into more "grown-up" scripting techniques, advanced approaches, data handling, and a lot more. As an Agile-published book, Don and Jeff can continue to update this book, as the more-advanced topics (more so than the entry-level ones) are the ones affected by new version releases.

APPLIES TO MANY VERSIONS OF POWERSHELL! If you're using PowerShell v4, v5, v5.1, or PowerShell Core v6, you'll find everything in this book is applicable to you in some form or another (although in PowerShell Core, any Windows-specific examples may not be functional).

NOW COVERS PESTER! Take your scripting to the next level by incorporating professional unit-testing using the ubiquitous Pester testing framework for PowerShell. A whole new Part of this book covers everything you'll need to know.

See the Contents

Use the "Table of Contents" link to see the complete table of contents for the full book. This does change and evolve as we work on the book. Note that the free sample reviews the complete ToC, but isn't necessarily up to date or entirely complete.

Hands-On Labs

You'll even find review questions and hands-on labs, complete with sample solutions, along with a short lab setup guide. These features will help you practice what you're learning, and make the book suitable for use in classroom settings (we recommend contacting the authors for an inexpensive site license, if you're a training center; we also provide slide decks, delivery guides, and other materials as part of a training center or trainer license).

We Publish as We Go

This is an Agile-published book, which means the authors are releasing it as they write it, and will continue to update the book as the underlying technology evolves over time. Assuming you meet the pre-requisites, this is the last book you'll ever need to buy on this topic, because your one-time purchase grants you lifetime access to updates and new content. We'll even email you via LeanPub (if you opt-in) when there's fresh content for you.

About Our Pricing

The price for this book might seem high. But that's because it's the last you'll ever have to buy. We won't be after you for a "second edition" in a couple of years, because you'll get each new update and release for free. So the higher price? This reflects that fact that you're paying up-front for what amounts to a lifetime subscription - we'll never come after you for more money for some future edition, reprinting, or update.

Check Out the Free Sample

The free sample includes sample chapters, but why bother? LeanPub has a no-questions-asked refund policy, so it's completely risk-free to grab the "real" book and see what you think. We trust you to do the right thing!

What Formats are Available?

All LeanPub books are offered in PDF, MOBI, and EPUB, and you get all three with your purchase. Note that the PDF is probably the "highest fidelity" version, especially in terms of code listings.

How Can I Contact the Authors?

We love feedback. Use the "Email the Authors" link, just below, to contact us. For feedback on the book, please provide a chapter, heading, and short snippet of text to let us know where you're looking - page numbers don't do any good, as they don't correspond with our source files.

A Note on Other Booksellers

Note that "Numbered Editions" of this book may also be available on Amazon or through other booksellers (e.g., "First Edition," "Second Edition," etc.) These are "snapshots" of the LeanPub version from a particular project milestone. Purchases made elsewhere are a one-time purchase, and do not include ongoing updates to the content. If you purchased the book elsewhere, we regrettably cannot somehow give you access to the LeanPub version, nor will you receive future updates at no charge.

Table of Contents

  •  
    • About This Book
    • Dedication
    • Acknowledgements
    • About the Authors
      • Additional Credits
    • Foreword
    • Feedback
    • Introduction
      • Pre-Requisites
      • Versioning
      • The Journey
      • Following Along
      • Providing Feedback
    • A Note on Code Listings
    • Lab Setup
      • What You’ll Need
      • Setting Up a Virtual Machine
      • Installing Windows 10
      • Adding Lab Files and Configuring PowerShell
      • Assumptions Going Forward
  • Part 1: Review: PowerShell Toolmaking
    • Functions, the Right Way
      • Tool Design
      • Start with a Command
      • Build a Basic Function and Module
      • Adding CmdletBinding and Parameterizing
      • Emitting Objects as Output
      • Using Verbose, Warning, and Informational Output
      • Comment-Based Help
      • Handling Errors
      • Ready to Go?
    • Verify Yourself
      • The Transcript
      • Our Read-Through
      • Our Answer
      • How’d You Do?
  • Part 2: Professional-Grade Toolmaking
    • Going Deeper with Parameters
      • Parameter Position
      • Validation
      • Multiple Parameter Sets
      • Value From Remaining Arguments
      • Help Message
      • Alias
      • More CmdletBinding
      • A Demonstration
      • Let’s Review
    • Dynamic Parameters
      • Declaring Dynamic Parameters
      • Using Dynamic Parameters
      • Let’s Review
    • Writing Full Help
      • External Help
      • Using Platyps
      • Supporting Online Help
      • “About” Topics
      • Making Your Help Updatable
      • Your Turn
      • Let’s Review
    • Unit Testing Your Code
      • Starting Point
      • Sketching Out the Test
      • Making Something to Test
      • Expanding the Test
      • But Wait, There’s More
      • Your Turn
      • Let’s Review
    • Extending Output Types
      • Understanding Types
      • The Extensible Type System
      • Extending an Object
      • Using Update-TypeData
      • Next Steps
    • Advanced Debugging
      • Getting Fancy with Breakpoints
      • Getting Strict
      • Getting Remote
      • Let’s Review
    • Command Tracing
      • Getting in PowerShell’s Brain
    • Analyzing Your Script
      • Performing a Basic Analysis
      • Analyzing the Analysis
      • Your Turn
    • Controlling Your Source
      • The process
      • Tools and Technologies
      • Let’s Review
    • Converting a Function to a Class
      • Class Background
      • Starting Point
      • Doing the Design
      • Making the Class Framework
      • Coding the Class
      • Adding a Method
      • Making classes easy to use
      • Wrapping Up
    • Publishing Your Tools
      • Begin with a Manifest
      • Publishing to PowerShell Gallery
      • Publishing to Private Repositories or Galleries
      • Your Turn
      • Let’s Review
  • Part 3: Controller Scripts and Delegated Administration
    • Basic Controllers: Automation Scripts and Menus
      • Building a Menu
      • Using UIChoice
      • Writing a Process Controller
      • Your Turn
      • Let’s Review
    • Graphical Controllers in WPF
      • Design First!
      • WinForms or WPF?
      • WPF Architecture
      • Using .NET
      • Using XAML
      • A Complete Example
      • Just the Beginning
      • Recommendations
      • Your Turn
      • Let’s Review
    • Proxy Functions
      • For Example
      • Creating the Proxy Base
      • Modifying the Proxy
      • Adding or Removing Parameters
      • Your Turn
      • Let’s Review
    • Just Enough Administration: A Primer
      • Requirements
      • Theory of Operation
      • Roles
      • Endpoints
      • Let’s Review
    • PowerShell in ASP.NET: A Primer
      • Caveats
      • The Basics
      • Beyond ASP.NET
  • Part 4: The Data Connection
    • Working with SQL Server Data
      • SQL Server Terminology and Facts
      • Connecting to the Server and Database
      • Writing a Query
      • Running a Query
      • Invoke-Sqlcmd
      • Thinking About Tool Design Patterns
      • Let’s Review
      • Review Answers
    • Working with XML Data
      • Simple: CliXML
      • Importing Native XML
      • ConvertTo-XML
      • Creating native XML from scratch
      • Your Turn
      • Let’s Review
    • Working with JSON Data
      • Converting to JSON
      • Converting from JSON
      • Your Turn
      • Let’s Review
  • Part 5: Seriously Advanced Toolmaking
    • Tools for Toolmaking
      • Editors
      • 3rd Party
      • Modules
      • Books, Blogs and Buzz
      • Recommendations
    • Measuring Tool Performance
      • Is Performance Important?
      • Measure What’s Importance
      • Factors Affecting Performance
      • Key Take-Away
    • PowerShell Workflows: A Primer
      • Terminology
      • Theory of Execution
      • A Quick Illustration
      • When to Workflow?
      • Sequences and Parallels are Standalone Scopes
      • Workflow Example
      • Workflow Common Parameters
      • Checkpointing Workflows
      • Workflows and Output
      • Your Turn
      • Let’s Review
    • Globalizing Your Tools
      • Starting Point
      • Make a Data File
      • Use the Data File
      • Adding Languages
      • Defaults
      • Let’s Review
    • Using “Raw” .NET Framework
      • Understanding .NET Framework
      • Interpreting .NET Framework Docs
      • Coding .NET Framework in PowerShell
      • Loading Assemblies
      • Wrap It
      • Your Turn
      • Let’s Review
    • Scripting at Scale
      • To Pipeline or not?
      • Foreach vs Foreach-Object
      • Write-Progress
      • Leverage Remoting
      • Leverage Jobs
      • Leverage Runspaces
      • Design Considerations
      • Your Turn
      • Let’s Review
    • Scaffolding a Project with Plaster
      • Getting Started
      • Plaster Fundamentals
      • Invoking a Plaster Template
      • Creating a Plaster Module Template
      • Creating a Plaster Function Template
      • Integrating Plaster into your PowerShell Experience
      • Creating Plaster Tooling
    • Toolmaking Tips and Tricks
    • write sorted results to the pipeline
  • Part 6: Pester
    • Why Pester Matters
    • Core Pester Concepts
      • Installing Pester
      • What is Pester?
      • Pester’s Weak Point
      • Understand Unit Testing
      • Scope
      • Sample Code
      • New-Fixture
    • Writing Testable Code
    • Describe Blocks
    • Context Blocks
      • BeforeEach and AfterEach
    • It Blocks
    • Should and Assertions
      • Should Operators
    • Mocks
      • Where to Mock
      • How to Mock
      • Verifiable Mocks
      • Parameter Filters
      • Mocking the Unmockable
    • Pester’s TESTDRIVE:
      • Clean Slate and Auto-Cleanup
      • Working with Sample Data
      • Using TESTDRIVE:
    • Pester for Infrastructure Validation
      • Spinning Up the Validation Environment
      • Taking Actual Action
      • Testing the Outcomes of Your Actions
    • Measuring Code Coverage
      • Displaying Code Coverage Metrics
    • Test-Driven Development
    • Release Notes

Bundles that include this book

The DSC Book
The PowerShell Scripting and Toolmaking Book
Become Hardcore Extreme Black Belt PowerShell Ninja Rockstar
Be the Master
How to Find a Wolf in Siberia
11 Books
$179.94
Regular Price
$175.00
Bundle Price

About the Authors

Don Jones
Don Jones

Don Jones has been in the IT industry since the mid 1990s, and has been a recipient of Microsoft's "Most Valuable Professional" Award since 2003. He's a co-founder of PowerShell.org and The DevOps Collective, and a Curriculum Director for online video training company Pluralsight. Don authored some of the first books ever published for Windows PowerShell, and is the co-author of Learn Windows PowerShell in a Month of Lunches, the bestselling entry-level book for PowerShell. Don's a sought-after speaker at technology conferences like Microsoft Ignite, TechMentor, and many more. You can find him on Twitter @concentratedDon, or on his website, DonJones.com. 

Jeff Hicks
Jeff Hicks

Jeffery Hicks is an IT veteran with over 25 years of experience, much of it spent as an IT infrastructure consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He is a multi-year recipient of the Microsoft MVP Award. He works today as an independent author, trainer and consultant. You can keep up with Jeff on his blog at http://blog.jdhitsolutions.com

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors and publishers use Leanpub to publish amazing in-progress and completed ebooks, just like this one. You can use Leanpub to write, publish and sell your book as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub