
Invoke-RestMethod :
The controller for path '/orgname/projectname/apis/wit/workitems/$task' was not found or does not implement IController.
html {.....+ Invoke-RestMethod -Uri $uri -Method POST -Headers $AzureDevOpsAutheni ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
$AzureDevOpsPAT = 'blablabla'
$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic '+
[Convert]::ToBase64String([Text.Encoding]:: ASCII.GetBytes(":$($AzureDevOpsPAT)")) }$OrganizationName = "orgname"
$UriOrganization= "https://dev.azure.com/$($OrganizationName)/"$WorkItemType = "task" #set there the WorkItemType
$WorkItemTitle = "Test from Powershell" #set the Title
$ProjectName = "projectname"; # set the ProjectName
$uri = $UriOrganization + $ProjectName + "/apis/wit/workitems/$" + $WorkItemType + "?api-version=5.1"echo $uri$body="[
{
`"op`": `"add`",
`"path`": `"/fields/System.Title`",
`"value`":`"$($WorkItemTitle)`"
}
]"Invoke-RestMethod -Uri $uri -Method POST -Headers $AzureDevOpsAuthenicationHeader -ContentType "application/json-patch+json" -Body $body