Update-GitLabPSModuleVersion
SYNOPSIS
Update the version of a PowerShell module in GitLab and NuGet.
SYNTAX
Update-GitLabPSModuleVersion [[-gitlabURI] <String>] [[-gitlabToken] <String>] [[-moduleRoot] <String>]
[[-nugetFeed] <String>] [[-nugetBaseURI] <String>] [[-nugetToken] <String>]
DESCRIPTION
This function automates the process of updating the version of a PowerShell module in GitLab and NuGet. It validates the module manifest, retrieves the current and previous versions, and updates the version based on the branch and commit message. The function also tags the commit with the updated version and ensures dependencies are installed or updated.
EXAMPLES
EXAMPLE 1
Update-GitLabPSModuleVersion -gitlabURI "https://gitlab.example.com/api/v4/projects/123" -gitlabToken "abc123" -moduleRoot "C:\Modules\MyModule"
Updates the version of the PowerShell module located in "C:\Modules\MyModule" and tags the commit in GitLab.
EXAMPLE 2
Updates the version of the PowerShell module using environment variables for GitLab and NuGet authentication.
EXAMPLE 3
Update-GitLabPSModuleVersion -nugetFeed "MyNuGetFeed" -nugetBaseURI "https://nuget.example.com/nuget" -nugetToken "xyz789"
Updates the version of the PowerShell module and publishes it to the specified NuGet feed.
PARAMETERS
-gitlabURI
The base URI of the GitLab project. If not provided, it is derived from the GitLab environment variables.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-gitlabToken
The GitLab API token used for authentication. If not provided, it is retrieved from PasswordState.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-moduleRoot
The root directory of the PowerShell module. If not provided, the current working directory is used.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-nugetFeed
The name of the NuGet feed where the module is stored. Default is "PSGalleryServer".
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: PSGalleryServer
Accept pipeline input: False
Accept wildcard characters: False
-nugetBaseURI
The base URI of the NuGet repository. Default is "https://nuget.gentgrp.gent.be/nuget".
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: Https://nuget.gentgrp.gent.be/nuget
Accept pipeline input: False
Accept wildcard characters: False
-nugetToken
The API key for the NuGet repository. If not provided, it is retrieved from PasswordState.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False