Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Configuration

Nicholas M. Getchell edited this page Sep 23, 2018 · 1 revision

PSGitLab requires configuration information before you can interact with the your GitLab instance.

Save-GitLabConfiguration

The GitLab API requires a base URL, a token to identify the user, and a version of the API to run against. The Save-GitLabConfiguration settings persist across PowerShell sessions.

Save-GitLabAPIConfiguration -Token 'apitoken' -Domain 'https://devlopment.gitlab.local' -APIVersion 4

This sets a file in the following locations.

  • Windows: "c:\Users\username\AppData\Roaming\PSGitLab\PSGitLabConfiguration.xml"
  • Linux: "/home/username/.psgitlab/PSGitLabConfiguration.xml"
  • MacOS: "/home/username/.psgitlab/PSGitLabConfiguration.xml"

Note: The file is stored in a secure fashion on Windows but in plain-text on MacOS and Linux. We are waiting for support in PowerShell Core via issue 1654.

Environment Variables

PSGitLab can be con If you are looking to run against a test instance of GitLab for development purposes, setting the configuration as environment variables allows you to override the configuration file. The settings are temporary and are lost when the console is closed.

To override the default configuration run the following:

$env:PSGitLabDomain = 'https://development.gitlab.local'
$env:PSGitLabToken = 'apitoken'
$env:PSGitLabAPIVersion = '4'
Clone this wiki locally