Export-GitHubModuleSettings

SYNOPSIS

Saves the module settings & token to a file

SYNTAX

__AllParameterSets

Export-GitHubModuleSettings [[-GitHubConfigPath] <string>] [[-GitHubConfigFile] <string>] [-WhatIf]
 [-Confirm]

ALIASES

This cmdlet has the following aliases,

  • Get-GHExportModuleSettings

DESCRIPTION

The Export-GitHubModuleSettings function saves the base uri, upload uri, API version, retry, timeout & JSON settings & the stored token (if any) to a PowerShell data file (.psd1)

The token is stored with ConvertFrom-SecureString. On Windows this uses the Data Protection API (DPAPI), so only the same user on the same machine can read it. On Linux & macOS the token is NOT encrypted, protect the file or use the GITHUB_TOKEN environment variable instead

The file is imported automatically when the module loads (default location only) or with Import-GitHubModuleSettings

Default location: ~/Celerium.GitHub/config.psd1

EXAMPLES

EXAMPLE 1

Export-GitHubModuleSettings

Saves the settings to the default location

EXAMPLE 2

Export-GitHubModuleSettings -GitHubConfigPath 'C:\Temp\GitHub' -GitHubConfigFile 'MyConfig.psd1'

Saves the settings to C:\Temp\GitHub\MyConfig.psd1

PARAMETERS

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-GitHubConfigFile

Name of the settings file

Defaults to config.psd1

Type: System.String
DefaultValue: config.psd1
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-GitHubConfigPath

Folder the settings file is saved in

Defaults to Celerium.GitHub in the user profile folder

Type: System.String
DefaultValue: (Join-Path -Path ([System.Environment]::GetFolderPath('UserProfile')) -ChildPath 'Celerium.GitHub')
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

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

INPUTS

OUTPUTS

NOTES

Aliases: Get-GHExportModuleSettings