Building Better Bricks: Module design and development best practice

By Chris Gardner

Talk Abstract

We’re all writing modules (probably) so let’s look at some of the ways we can make our modules better, both for people developing them and for people using them. Warning: some ranting may occur and sysadmins (and more) will be called developers.

Talk Description

To create reusable tools we should be aiming to write functions and then package those up into modules for distribution. A major benefit of PowerShell is its flexibility in how you can solve a problem, packaging your modules can be one of these problems and it has many solutions.

This talk will look at the main approaches that are used, common pitfalls, and some of the best practices that should be used to make developing the module as low effort as possible. We’ll also look at how we can make publishing the module easier, and ease the use for end users.

Notes

I’ve given this presentation in a number of places and it’s proving to be an interesting and evolving topic. It started with PSH Summit 2018 as a side session and has spiralled from there to most of the UK user groups, PS Saturday Paris, PSDay UK, PSConfAsia and no doubt many more user groups.

I’ve also been working on a related project to try to analyse the help for all the modules in the PowerShellGallery (hopefully it’ll be done soon) which involved a lot of Import-Module and a whole range of interesting problems with the way people handle various things like credentials and such on import. It led me to fixing a lot of modules just so I could get the commands and help out of them and discovering even more things that people are doing badly with their modules, which has provided more content for this talk.

Currently it’s not very demo heavy, there’s a few things I show off in terms of running code but I’m working on some options for that as I refactor the talk and it’s content.