From the course: PowerShell: Automating Administration

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create modules

Create modules - Server Tutorial

From the course: PowerShell: Automating Administration

Start my 1-month free trial

Create modules

- [Instructor] The more your experiment and work with PowerShell, the more scripts you're going to write and many of those scripts will contain functions. It's not out of line to think that over time some of those functions will start to repeat from one script to the next. If you save all of your functions only within the script where you created them, that's going to create redundant work and/or the need for a system to remember where a function exists so that you can find it, copy it, and paste it into the next use, but there's another solution. We've seen PowerShell modules from Microsoft and from others on the community at GitHub. You can create your own modules and you can store them within your organization to your own function library. A module is nothing more than a text file with the extensions PSM1, so it's fairly easy to create. This is going to be internally formatted just like a script, but it will only contain a library of aliases and functions. Creating a module is easy…

Contents