Creating an internal PowerShell repository
Public galleries such as PSGallery
are great sources of interesting and useful modules. You can also create your own PowerShell repository for either personal or corporate use.
There are several ways to set up an internal repository, for example using a third-party tool such as ProGet from Inedo (see https://inedo.com/ for details on ProGet). The simplest way is to set up an SMB file share and use the Register-PSRepository
command to set up the repository. Once set up, you can use the Publish-Module
command to upload modules to your new repository and then use the repository to distribute organizational modules.
Getting ready
This recipe runs on the SRV1
server.
How to do it...
- Create the repository folder: ...
Get Windows Server 2019 Automation with PowerShell Cookbook - Third Edition 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.