Я пытаюсь создать комментарий в ветке Запрос извлечения Azure Devops:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Variables
$organization = "movieseat"
$project = "pokedex"
$repositoryId = "Pokedex"
$pullRequestId = "97"
$threadId = "283"
$pat = "Bearer $env:System_AccessToken"
$body = @"
{
"content"="Finished building feature branch"
"commentType"="text";
}
"@
$postURL = "https://dev.azure.com/$organization/$project/_apis/git/repositories/$repositoryId/pullRequests/$pullRequestId/threads/$threadId/comments?api-version=5.0"
$prComment = Invoke-RestMethod -Uri $postURL -Headers @{Authorization = $pat} -Body $body -Method Post -ContentType 'application/json'
Write-Output $prComment
Но на этапе выпуска я получаю:
Invoke-RestMethod : {"$id":"1","innerException":null,"message":"Value cannot be null.\r\nParameter name:
comment","typeName":"System.ArgumentNullException,
mscorlib","typeKey":"ArgumentNullException","errorCode":0,"eventId":0}
At D:\a\r1\a\_Pokedex master\PokeDexArtifact\release\commentURL.ps1:49 char:14
+ ... prComment = Invoke-RestMethod -Uri $postURL -Headers @{Authorization ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
##[error]PowerShell exited with code '1'.
##[section]Finishing: PowerShell Script
Я не могу найти информацию, относящуюся к этой ошибке.