OfficeDev/Project-Samples

REST - Update project description (412) Precondition Failed

Opened this issue · 0 comments

Update project description not working from updateproject.ps1 for project created with createproject.ps1 - code:
$body = "{'Description':'Updated from PowerShell using REST API'}"
Patch-ReSTRequest $SiteUrl "ProjectServer/Projects('$projectid')/Draft" $body

Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (412) Precondition Failed."
At C:\vault\ps\ReST.ps1:126 char:5

  • $resp = $request.GetResponse()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : WebException