Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
18 changes: 16 additions & 2 deletions GitHubCore.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ function Invoke-GHRestMethod
used as the exception bucket value in the event of an exception. If neither is specified,
no bucket value will be used.

.PARAMETER ApiVersion
Version of the GitApi to use. Format is: yyyy-MM-dd

.OUTPUTS
[PSCustomObject] - The result of the REST operation, in whatever form it comes in.
[FileInfo] - The temporary file created for the downloaded file if -Save was specified.
Expand Down Expand Up @@ -151,7 +154,10 @@ function Invoke-GHRestMethod

[hashtable] $TelemetryProperties = @{},

[string] $TelemetryExceptionBucket = $null
[string] $TelemetryExceptionBucket = $null,

[ValidatePattern("\d\d\d\d-\d\d-\d\d")]
[string]$ApiVersion = "2022-11-28"
)

Invoke-UpdateCheck
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 @@ -632,6 +639,9 @@ function Invoke-GHRestMethodMultipleResult
followed.
WARNING: This might take a while depending on how many results there are.

.PARAMETER ApiVersion
Version of the GitApi to use. Format is: yyyy-MM-dd

.OUTPUTS
[PSCustomObject[]] - The result of the REST operation, in whatever form it comes in.

Expand Down Expand Up @@ -663,7 +673,10 @@ function Invoke-GHRestMethodMultipleResult

[string] $TelemetryExceptionBucket = $null,

[switch] $SinglePage
[switch] $SinglePage,

[ValidatePattern("\d\d\d\d-\d\d-\d\d")]
[string]$ApiVersion = "2022-11-28"
)

$AccessToken = Get-AccessToken -AccessToken $AccessToken
Expand Down Expand Up @@ -698,6 +711,7 @@ function Invoke-GHRestMethodMultipleResult
'AccessToken' = $AccessToken
'TelemetryProperties' = $telemetryProperties
'TelemetryExceptionBucket' = $errorBucket
'ApiVersion' = $ApiVersion
}

$result = Invoke-GHRestMethod @params
Expand Down