Skip to content

Publish-GitLabModule

SYNOPSIS

Publish a PowerShell module to a NuGet repository.

SYNTAX

Publish-GitLabModule [[-BranchName] <String[]>] [<CommonParameters>]

DESCRIPTION

This function automates the process of publishing a PowerShell module to a NuGet repository. It validates the branch, ensures required dependencies are installed, updates the module version, and publishes the module to the specified repository. The function also handles repository registration and cleans up temporary installations.

EXAMPLES

EXAMPLE 1

Publish-GitLabModule -BranchName @('main')

Publishes the PowerShell module if the current branch is "main".

EXAMPLE 2

Publish-GitLabModule

Publishes the PowerShell module if the current branch is "master" or "main".

PARAMETERS

-BranchName

The branch name(s) for which the module should be published. Default is `@('master', 'main')`.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: @('master', 'main')
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES