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

4

1 回答 1

0

令牌信息在这里:我在这里找到了令牌信息:https ://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

我应该运行 get-help 命令,而不是在线查找文档:

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

名称保存-GitLabAPIConfiguration

SYNOPSIS 用于存储有关 GitLab 实例的信息。

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

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

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

名称保存-GitLabAPIConfiguration

SYNOPSIS 用于存储有关 GitLab 实例的信息。

语法 Save-GitLabAPIConfiguration [-Token] [-Domain] [-APIVersion ] []

描述 用于存储有关 GitLab 实例的信息。给出了域和 api 令牌。

PARAMETERS -APIVersion 用于执行调用的 API 版本。

-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"

备注 要查看示例,请键入:“get-help Save-GitLabAPIConfiguration -examples”。有关更多信息,请键入:“get-help Save-GitLabAPIConfiguration -detailed”。有关技术信息,请键入:“get-help Save-GitLabAPIConfiguration -full”。如需在线帮助,请输入:“get-help Save-GitLabAPIConfiguration -online”

当我将 http: 放在它工作的域上时。似乎他们真的想要一个 URL,而不是域。

于 2018-06-04T14:43:56.087 回答