Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

PowerShell by Mistake

Get the formatting eBook in PDF, MOBI, or EPUB and support The DevOps Collective's scholarships and nonprofit programs.

100% of proceeds from this book support The DevOps Collective's scholarship and other nonprofit programs. The "Free Sample" (on the Leanpub website) is the entire book; you can choose to "buy" the book for any amount you like in order to make a donation.

Human brains are funny things. At the end of the day, our brains are still wired the same way they were when we were cavemen trying to survive in the wild. Anything relevant to our immediate survival tended to "stick" in our brains, and anything not relevant tends to slip past. Tell a child, "don't touch that hot pot on the stove!" all you want to, they're still likely to touch it—once.

This book is the hot pot on the stove. It's a collection of mistakes, and an opportunity to solve them, albeit without burning your fingers.

In this book, I've collected edited versions of PowerShell questions and "broken" code, and in each chapter I'll present a one. You'll take the time to read the code, figure out the problem, and try to solve it. Then, I'll present a solution, along with a detailed explanation of not only what was wrong, but why.

This book is not a how-to, and I presume that you already have a decent amount of basic PowerShell education under your belt. This book is not about how to make Active Directory work, or Exchange Server, or SharePoint Server, or anything else; this is about PowerShell. So you're going to see problems that relate to the core of how PowerShell works. Many of these problems spring from "gotchas" in PowerShell, while others have their origin in very common misunderstandings about how the shell works.

If you feel that you learn best by getting your hands dirty, making mistakes, and figuring them out, then this book is for you.

And if you've ever wondered, "do I really know what PowerShell is all about?" then you can consider this book to be an ongoing quiz of sorts. Each chapter offers a new opportunity to test your PowerShell mojo, validate what you know, and perhaps pick up a new trick or two along the way.

NOTE: This is a "continually published" book, and it is open-source. All proceeds (whatever you set the price to when you buy the book) are donated to The DevOps Collective's scholarship and other nonprofit programs.

How to Contribute

If you've found a problem, you're welcome to fix it!

  1. Start by forking the repo into your own account (the Fork button is at the upper-right)
  2. Go to your GitHub account and into the forked repo (
  3. Make whatever edits you like (the "pencil" icon when viewing a file)
  4. Submit a Pull Request to send your changes back to my repo

You're also welcome to open an Issue here, but be aware that I have very limited time to maintain the manuscript, so be prepared to wait a good long while.

You can’t perform that action at this time.