Productivity Tools

Tools written by an IT business manager, a passionate developer.

Publish-ModuleTo

Module perform recursive search for the psd1 file in given directory and then publish it to the chosen repository.

Publishing module to Powershell gallery is very straight-forward task. To do it we just need to invoke command

If we are pushing to different repository than default. We also can provide PSRepository  parameter.

When publishing module we are always providing the same pair of information, so described module help to automate it a little bit.

First of all Publish-ModuleTo¬†gets nugetApiKey from MasterConfiguration, so we don’t need to provide it every time we pushing module.

Additionally we don’t need to point to the exact psd1 path to publish module, as Publish-ModuleTo search recursively for psd1 file and push it.

This module is base for other, more specific ones. Please check out Publish-ModuleToPowershellGallery

Example

To use it first You need to save NugetApiKey in the MasterConfiguration

Next go to the directory of the module (or parent directory) and invoke