With PowerShellGet, the new package manager for PowerShell, you can easily perform discovery and installation of software packages, PowerShell modules etc. in a unified way. What makes it more attractive is the ease to contribute your modules to the community so that it’s discoverable and used by users who want to.
All you need is a Microsoft account and login to the PowerShell Gallery to download your API key to publish your module. Let’s see the step by step process for the same.
- Login to the PowerShell gallery at https://www.powershellgallery.com
- Once you have signed in, navigate to the account page to download the API Key (https://www.powershellgallery.com/account )
- Once you have the account key, you can use the Publish-Module command to publish your modules to the gallery.
- For e.g. I have a module to install Visual Studio 2015 on my machine.
- First we need to ensure that the module is available in our module path
- Now we can use the Publish-Module command as given below.
Publish-Module -Name VisualStudio2015 -NuGetApiKey $ApiKey -Verbose
- That’s it, it’s that simple to contribute!!!