Deployment and upgrade

Once you have finished developing a module, it is time to start deploying it. In Chapter 10, Creating Your Own PowerShell Repository, we will have an in-depth look at one deployment option: the PowerShell Gallery. For the time being, we will see how our modules can be distributed.

The structure of a module is already easily distributable. A module is a self-contained unit, consisting of a module manifest and one or more scripts, libraries, and module files. It can be compressed in its entirety and extracted to one or more target systems.

From PowerShell 5, side-by-side versioning is supported. This means that for each version defined in your manifest, you should create a sub-folder when deploying the module. This could result in a structure like the following:

The great thing is, in your scripts, you can import specific, tested versions of your module, while developing new features and testing them separately. Updating modules does not have to break your scripts, if you ensure that only a specific module version is being used.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset