0

I'm trying to use this package to automate some GitLab processes with PowerShell. https://www.powershellgallery.com/packages/PSGitLab/2.7.0

For my first test, I just ran this: Get-GitLabUser -ID "myuser"

and got this output; then tried to run Save-GitLabAPIConfiguration, but not sure what I'm supposed to enter for "Token" nor "Domain". I tried the domain I log with, and the URL of the GitLab website that I use; but it says it doesn't match the RegEx pattern.

enter image description here

NealWalters
  • 17,197
  • 42
  • 141
  • 251

1 Answers1

0

The info for the tokens is here: I found the token info here: https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

Rather than looking online for doc, I should have run the get-help commands:

BizTalk:\Applications> get-help Save-GitLabAPIConfiguration -examples

NAME Save-GitLabAPIConfiguration

SYNOPSIS Used to store information about your GitLab instance.

-------------------------- EXAMPLE 1 --------------------------

Save-GitLabAPIConfiguration -Domain http://gitlab.com -Token "mPnTssWyBCMjxxxxxxxJQ"

BizTalk:\Applications> get-help Save-GitLabAPIConfiguration -detailed

NAME Save-GitLabAPIConfiguration

SYNOPSIS Used to store information about your GitLab instance.

SYNTAX Save-GitLabAPIConfiguration [-Token] [-Domain] [-APIVersion ] []

DESCRIPTION Used to store information about your GitLab instance. The domain and api token are given.

PARAMETERS -APIVersion The version of API used to execute calls.

-Domain <Object>
    The domain your GitLab instance runs under. Example: http://gitlab.com.

-Token <Object>
    Your private token that can be found under the profile settings.

<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see 
    about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 

-------------------------- EXAMPLE 1 --------------------------

Save-GitLabAPIConfiguration -Domain http://gitlab.com -Token "mPnTssWyBCMjxxxxxxxJQ"

REMARKS To see the examples, type: "get-help Save-GitLabAPIConfiguration -examples". For more information, type: "get-help Save-GitLabAPIConfiguration -detailed". For technical information, type: "get-help Save-GitLabAPIConfiguration -full". For online help, type: "get-help Save-GitLabAPIConfiguration -online"

When I put http: on the domain it worked. Seems like they really want a URL, not a domain.

NealWalters
  • 17,197
  • 42
  • 141
  • 251