Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ Thank you to all of our contributors, no matter how big or small the contributio
- **[Giuseppe Campanelli (@themilanfan)](https://github.com/themilanfan)**
- **[Christoph Bergmeister (@bergmeister)](https://github.com/bergmeister)**
- **[Simon Heather (@X-Guardian)](https://github.com/X-Guardian)**
- **[Neil White (@variableresistor)](https://github.com/variableresistor)**

----------

Expand Down
14 changes: 14 additions & 0 deletions GitHubCore.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ function Invoke-GHRestMethod
If specified, this will save the result to a temporary file and return the FileInfo of that
temporary file.

.PARAMETER ApiVersion
Indicates the version of this API that should be used. Format is: 'yyyy-MM-dd'.

.PARAMETER AccessToken
If provided, this will be used as the AccessToken for authentication with the
REST Api as opposed to requesting a new one.
Expand Down Expand Up @@ -145,6 +148,9 @@ function Invoke-GHRestMethod

[switch] $Save,

[ValidatePattern('^\d{4}-\d{2}-\d{2}$')]
[string] $ApiVersion = "2022-11-28",

[string] $AccessToken,

[string] $TelemetryEventName = $null,
Expand Down Expand Up @@ -232,6 +238,7 @@ function Invoke-GHRestMethod
$headers = @{
'Accept' = $AcceptHeader
'User-Agent' = 'PowerShellForGitHub'
'X-GitHub-Api-Version' = $ApiVersion
}

# Add any additional headers
Expand Down Expand Up @@ -609,6 +616,9 @@ function Invoke-GHRestMethodMultipleResult
Allows the caller to specify any number of additional headers that should be added to
all of the requests made.

.PARAMETER ApiVersion
Indicates the version of this API that should be used. Format is: 'yyyy-MM-dd'.

.PARAMETER AccessToken
If provided, this will be used as the AccessToken for authentication with the
REST Api as opposed to requesting a new one.
Expand Down Expand Up @@ -660,6 +670,9 @@ function Invoke-GHRestMethodMultipleResult

[hashtable] $AdditionalHeader = @{},

[ValidatePattern('^\d{4}-\d{2}-\d{2}$')]
[string] $ApiVersion = "2022-11-28",

[string] $AccessToken,

[string] $TelemetryEventName = $null,
Expand Down Expand Up @@ -700,6 +713,7 @@ function Invoke-GHRestMethodMultipleResult
'AcceptHeader' = $AcceptHeader
'AdditionalHeader' = $AdditionalHeader
'ExtendedResult' = $true
'ApiVersion' = $ApiVersion
'AccessToken' = $AccessToken
'TelemetryProperties' = $telemetryProperties
'TelemetryExceptionBucket' = $errorBucket
Expand Down