Creating a snapshot management module

While running all of this from a function and using a .ps1 file works very well, there is a better way. PowerCLI users can actually take the work of a function and create their own module, just like the ones that are used when you use Import-Module in PowerShell or PowerCLI. By creating a module, you can locate this in a default PSModulePath for PowerShell and you can import it like any vendor supplied modules. You can also distribute this module to end users, help desk staff, or other administrators to ease management. By taking your function or functions to this level, you can gain portability for the code that you've created.

It is important to note that any script file with one or more functions can become ...

Get PowerCLI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.