ProductivityTools.PSPublishModuleToPowershellGallery.psm1

1
2
3
4
5
6
7
8
9
10
11

function Publish-ModuleToPowershellGallery {
    [CmdletBinding()]
    param()
    
    $repository=Get-PSRepository |where { $_.SourceLocation -eq "https://www.powershellgallery.com/api/v2/"}
    $repositoryName=$repository.Name
    Publish-ModuleTo -PSRepository $repositoryName -PSRepositoryApiKey "PSRepositoryApiKey" -Verbose:$VerbosePreference
}

Export-ModuleMember  Publish-ModuleToPowershellGallery