PowerShell module starter kit – updated for 2019

A couple years ago I wrote a PowerShell module starter kit (here). The goal was to provide an example for organizing a module using best practices and provide a live repository you could clone and play around with.

I’ve taken that starter kit module and updated it for 2019. Incorporating some new best practices and new usage patterns that I find helpful. Head over to the GitHub link to check it out!

Project: https://github.com/keithbabinec/PowerShellModuleStarterKit.

What’s new in this release?

  1. Added examples to store and reference module-scoped constants.
  2. Added examples to read/write to a module-scoped cache (to store data across function calls).
  3. Added examples for exporting V5 classes to use outside of module scope.
  4. Added examples for packaging and referencing non-PowerShell module file resources (things like .json documents).
  5. Added examples for referencing and using external libraries (ex: Newtonsoft.JSON).
  6. Switched unit tests to use InModuleScope for private function testing.
  7. Switched unit tests to use module loading by name, instead of module manifest relative path.
  8. Updated documentation for how to load the module and run the unit tests.
  9. Reorganized project folder structure (particularly around tests).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s