Initialize-GitHubModuleSettings
SYNOPSIS
Changes the in-memory settings of the module
SYNTAX
__AllParameterSets
Initialize-GitHubModuleSettings [[-ApiVersion] <string>] [[-MaxRetryCount] <int>]
[[-MaxRateLimitWaitSeconds] <int>] [[-TimeoutSeconds] <int>] [[-JsonConversionDepth] <int>]
[[-UserAgent] <string>] [-Reset]
ALIASES
This cmdlet has the following aliases,
- Get-GHInitializeModuleSettings
DESCRIPTION
The Initialize-GitHubModuleSettings function changes the settings used by Invoke-GitHubRequest for the current session. Only the parameters that are used are changed. Use Export-GitHubModuleSettings to save them
Defaults
ApiVersion 2026-03-10
MaxRetryCount 3
MaxRateLimitWaitSeconds 300
TimeoutSeconds 100
JsonConversionDepth 100
UserAgent Celerium.GitHub/
EXAMPLES
EXAMPLE 1
Initialize-GitHubModuleSettings -MaxRetryCount 5 -TimeoutSeconds 30
Changes the retry count & timeout
EXAMPLE 2
Initialize-GitHubModuleSettings -ApiVersion '2022-11-28'
Uses an older API version for all requests
EXAMPLE 3
Initialize-GitHubModuleSettings -Reset
Resets the settings to the defaults
PARAMETERS
-ApiVersion
Value of the X-GitHub-Api-Version header (yyyy-MM-dd)
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-JsonConversionDepth
Depth used when request bodies are converted to JSON (1 - 100)
Type: System.Int32
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-MaxRateLimitWaitSeconds
Longest time the module waits for a rate limit to reset, a longer wait throws an error with the reset time
Type: System.Int32
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-MaxRetryCount
Number of times a request is retried after a rate limit, a gateway error (GET only) or a transport failure
Type: System.Int32
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Reset
Reset every setting above to its default before applying the other parameters
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-TimeoutSeconds
Time to wait for one HTTP response
Type: System.Int32
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-UserAgent
User-Agent header value
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 5
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-GHInitializeModuleSettings