Critique: build-your-own-ps-module.md

A thorough and loving evisceration of Steve’s guide, offered in the spirit of good faith collaboration and mild personal amusement.


The Title Problem

“No fluff, no theory — just the steps that work.”

The document is 1,847 lines long.


”Slightly Depreciated”

First sentence of the entire document:

“This may be slightly depreciated based on the eventual 2 man set up”

Depreciated means a reduction in financial value over time, like a car or an asset. The word you want is deprecated, which means a feature or document is outdated and scheduled for removal. Your guide isn’t worth less money than it used to be. Unless it is, in which case I’d like to know what you were selling it for originally.


The Guide Shipped with Its Own Bug

The dispatcher code in The Module File section contains this line:

if ($commands.ContainsKey($Command)) {

This is an [ordered] hashtable. OrderedDictionary does not have ContainsKey(). It has Contains().

The guide on how to build a module contains the exact bug that broke the module.

This is either a profound teaching moment or a cry for help. Possibly both.


The PS7 Contradiction

The guide opens with:

“PS 5.1 ships with Windows but it runs on an older .NET version. Use PS7 and you will not hit those problems.”

The manifest template then specifies:

PowerShellVersion = '5.1'

The guide explicitly tells you to use PS7, then tells you to declare that your module requires PS5.1 as a minimum. Which is fine, that’s actually correct practice — but it reads like the guide is hedging its own advice.


The .gitignore Doesn’t Work Properly

config.local.ps1

This pattern only matches a file called config.local.ps1 in the root of the repo. If someone puts it in a subdirectory — like Private\config.local.ps1 — it won’t be excluded. The correct pattern is:

**/config.local.ps1

Same issue with secrets.ps1. A guide this thorough on everything else shouldn’t have a gitignore that doesn’t actually ignore things.


What Is Actually Good

To be fair, and there is a lot to be fair about:

  • The manifest rules section is excellent and the examples of wrong vs correct are exactly what people need
  • The common errors section would have saved about 4 hours of collective suffering across our careers
  • The checklist at the end is genuinely useful and the kind of thing most guides don’t bother with
  • The Install.ps1 script is clean, well-commented, and does more than most people would bother writing

The guide is thorough to a fault, which is better than the alternative. It’s just funny that the one bug in the whole thing is sitting right in the example code, quietly waiting.


Fix the ContainsKey. You know where it is.