O'Reilly logo

PowerCLI Cookbook by Philip Sellers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required