@@ -40,10 +40,10 @@ function Get-GitHubComment
4040 . PARAMETER MediaType
4141 The format in which the API will return the body of the comment.
4242
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.
4747
4848 . PARAMETER AccessToken
4949 If provided, this will be used as the AccessToken for authentication with the
@@ -181,7 +181,7 @@ function Get-GitHubComment
181181 ' UriFragment' = $uriFragment
182182 ' Description' = $description
183183 ' AccessToken' = $AccessToken
184- ' AcceptHeader' = (Get-CommentAcceptHeader - MediaType $MediaType )
184+ ' AcceptHeader' = (Get-MediaAcceptHeader - MediaType $MediaType - AcceptHeader $squirrelAcceptHeader )
185185 ' TelemetryEventName' = $MyInvocation.MyCommand.Name
186186 ' TelemetryProperties' = $telemetryProperties
187187 ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
@@ -220,10 +220,10 @@ function New-GitHubComment
220220 . PARAMETER MediaType
221221 The format in which the API will return the body of the comment.
222222
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.
227227
228228 . PARAMETER AccessToken
229229 If provided, this will be used as the AccessToken for authentication with the
@@ -292,7 +292,7 @@ function New-GitHubComment
292292 ' Method' = ' Post'
293293 ' Description' = " Creating comment under issue $Issue for $RepositoryName "
294294 ' AccessToken' = $AccessToken
295- ' AcceptHeader' = (Get-CommentAcceptHeader - MediaType $MediaType )
295+ ' AcceptHeader' = (Get-MediaAcceptHeader - MediaType $MediaType - AcceptHeader $squirrelAcceptHeader )
296296 ' TelemetryEventName' = $MyInvocation.MyCommand.Name
297297 ' TelemetryProperties' = $telemetryProperties
298298 ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
@@ -331,10 +331,10 @@ function Set-GitHubComment
331331 . PARAMETER MediaType
332332 The format in which the API will return the body of the comment.
333333
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.
338338
339339 . PARAMETER AccessToken
340340 If provided, this will be used as the AccessToken for authentication with the
@@ -403,7 +403,7 @@ function Set-GitHubComment
403403 ' Method' = ' Patch'
404404 ' Description' = " Update comment $CommentID for $RepositoryName "
405405 ' AccessToken' = $AccessToken
406- ' AcceptHeader' = (Get-CommentAcceptHeader - MediaType $MediaType )
406+ ' AcceptHeader' = (Get-MediaAcceptHeader - MediaType $MediaType - AcceptHeader $squirrelAcceptHeader )
407407 ' TelemetryEventName' = $MyInvocation.MyCommand.Name
408408 ' TelemetryProperties' = $telemetryProperties
409409 ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
@@ -501,36 +501,3 @@ function Remove-GitHubComment
501501 return Invoke-GHRestMethod @params
502502}
503503
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