PowerShell function for creating a script module template

I’m curious to know what process others use to create new PowerShell script modules?

Since the initial process of creating a PowerShell script module seems redundant and tedious, I decided to create a function that creates a template for new script modules that I create which includes creating both the script module PSM1 and manifest PSD1 files and filling in the information that I would normally include:

When the previous function is run, a folder with the specified module name is created along with the PSM1 and PSD1 files. The PSM1 is set to dot source any function that exists in the module’s folder. I could have easily coded the specific user and all users paths for modules into the function, but I rarely develop new modules in either of those locations.


The function shown in this blog article is a work in progress and can be downloaded from my PowerShell repository on GitHub. Feel free to fork the repository and submit pull requests if you can think of improvements that could be made to the code shown in this blog article.



  1. Nicholas M. Getchell

    Have you seen https://github.com/PowerShell/Plaster? I’ve been using it and created my own template. Not the easiest thing to do but I’m loving how easy it is now to create a whole repository.

  2. mathieu Buisson

    I agree with Nicholas M. Getchell, Plaster is great for that purpose.
    It offers a great integration with the whole PowerShell ecosystem : code editors, Pester, Psake…
    Also in the future, it will most likely add other templates in addition to the standard script module.


Leave a Reply to Nicholas M. Getchell Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: