@@ -40,10 +40,10 @@ function Get-GitHubComment
40
40
. PARAMETER MediaType
41
41
The format in which the API will return the body of the comment.
42
42
43
- raw - Return the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
44
- text - Return a text only representation of the markdown body. Response will include body_text.
45
- html - Return HTML rendered from the body's markdown. Response will include body_html.
46
- full - Return raw, text and HTML representations. Response will include body, body_text, and body_html.
43
+ Raw - Return the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
44
+ Text - Return a text only representation of the markdown body. Response will include body_text.
45
+ Html - Return HTML rendered from the body's markdown. Response will include body_html.
46
+ Full - Return raw, text and HTML representations. Response will include body, body_text, and body_html.
47
47
48
48
. PARAMETER AccessToken
49
49
If provided, this will be used as the AccessToken for authentication with the
@@ -181,7 +181,7 @@ function Get-GitHubComment
181
181
' UriFragment' = $uriFragment
182
182
' Description' = $description
183
183
' AccessToken' = $AccessToken
184
- ' AcceptHeader' = (Get-CommentAcceptHeader - MediaType $MediaType )
184
+ ' AcceptHeader' = (Get-MediaAcceptHeader - MediaType $MediaType - AcceptHeader $squirrelAcceptHeader )
185
185
' TelemetryEventName' = $MyInvocation.MyCommand.Name
186
186
' TelemetryProperties' = $telemetryProperties
187
187
' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
@@ -220,10 +220,10 @@ function New-GitHubComment
220
220
. PARAMETER MediaType
221
221
The format in which the API will return the body of the comment.
222
222
223
- raw - Return the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
224
- text - Return a text only representation of the markdown body. Response will include body_text.
225
- html - Return HTML rendered from the body's markdown. Response will include body_html.
226
- full - Return raw, text and HTML representations. Response will include body, body_text, and body_html.
223
+ Raw - Return the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
224
+ Text - Return a text only representation of the markdown body. Response will include body_text.
225
+ Html - Return HTML rendered from the body's markdown. Response will include body_html.
226
+ Full - Return raw, text and HTML representations. Response will include body, body_text, and body_html.
227
227
228
228
. PARAMETER AccessToken
229
229
If provided, this will be used as the AccessToken for authentication with the
@@ -292,7 +292,7 @@ function New-GitHubComment
292
292
' Method' = ' Post'
293
293
' Description' = " Creating comment under issue $Issue for $RepositoryName "
294
294
' AccessToken' = $AccessToken
295
- ' AcceptHeader' = (Get-CommentAcceptHeader - MediaType $MediaType )
295
+ ' AcceptHeader' = (Get-MediaAcceptHeader - MediaType $MediaType - AcceptHeader $squirrelAcceptHeader )
296
296
' TelemetryEventName' = $MyInvocation.MyCommand.Name
297
297
' TelemetryProperties' = $telemetryProperties
298
298
' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
@@ -331,10 +331,10 @@ function Set-GitHubComment
331
331
. PARAMETER MediaType
332
332
The format in which the API will return the body of the comment.
333
333
334
- raw - Return the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
335
- text - Return a text only representation of the markdown body. Response will include body_text.
336
- html - Return HTML rendered from the body's markdown. Response will include body_html.
337
- full - Return raw, text and HTML representations. Response will include body, body_text, and body_html.
334
+ Raw - Return the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
335
+ Text - Return a text only representation of the markdown body. Response will include body_text.
336
+ Html - Return HTML rendered from the body's markdown. Response will include body_html.
337
+ Full - Return raw, text and HTML representations. Response will include body, body_text, and body_html.
338
338
339
339
. PARAMETER AccessToken
340
340
If provided, this will be used as the AccessToken for authentication with the
@@ -403,7 +403,7 @@ function Set-GitHubComment
403
403
' Method' = ' Patch'
404
404
' Description' = " Update comment $CommentID for $RepositoryName "
405
405
' AccessToken' = $AccessToken
406
- ' AcceptHeader' = (Get-CommentAcceptHeader - MediaType $MediaType )
406
+ ' AcceptHeader' = (Get-MediaAcceptHeader - MediaType $MediaType - AcceptHeader $squirrelAcceptHeader )
407
407
' TelemetryEventName' = $MyInvocation.MyCommand.Name
408
408
' TelemetryProperties' = $telemetryProperties
409
409
' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
@@ -501,36 +501,3 @@ function Remove-GitHubComment
501
501
return Invoke-GHRestMethod @params
502
502
}
503
503
504
- function Get-CommentAcceptHeader
505
- {
506
- <#
507
- . DESCRIPTION
508
- Returns a formatted AcceptHeader based on the requested MediaType
509
-
510
- The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub
511
-
512
- . PARAMETER MediaType
513
- The format in which the API will return the body of the comment.
514
-
515
- raw - Return the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
516
- text - Return a text only representation of the markdown body. Response will include body_text.
517
- html - Return HTML rendered from the body's markdown. Response will include body_html.
518
- full - Return raw, text and HTML representations. Response will include body, body_text, and body_html.
519
-
520
- . EXAMPLE
521
- Get-CommentAcceptHeader -MediaType Raw
522
-
523
- Returns a formatted AcceptHeader for v3 of the response object
524
- #>
525
- [CmdletBinding ()]
526
- param (
527
- [ValidateSet (' Raw' , ' Text' , ' Html' , ' Full' )]
528
- [string ] $MediaType = ' Raw'
529
- )
530
-
531
- $acceptHeaders = @ (
532
- ' application/vnd.github.squirrel-girl-preview' ,
533
- " application/vnd.github.$mediaTypeVersion .$ ( $MediaType.ToLower ()) +json" )
534
-
535
- return ($acceptHeaders -join ' ,' )
536
- }
0 commit comments