title: Error while updating VSTS release definition from powershell
body: <p>I use the APIs listed in the VSTS API documentation <a href="https://docs.microsoft.com/en-us/rest/api/vsts/release/definitions/update?view=vsts-rest-4.1" rel="nofollow noreferrer">here</a>. On modifying a variable and saving the definition the error I get from the server is <code>VS402982: Retention policy is not set for the environment 'environmentName'</code>.</p>
  
  <p>The portion of the PS script that performs the update  is - </p>
  
  <pre><code>$c = Invoke-WebRequest 'https://accountname.vsrm.visualstudio.com/projectname/_apis/release/definitions/definitionId' -Method Get -Headers @{Authorization = 'Bearer ' + $authtoken} 
  $jsonObj = $c | ConvertFrom-Json
  $url3 = "https://accountname.vsrm.visualstudio.com/projectname/_apis/release/definitions/definitionId?api-version=4.1-preview.3";
  
  $contentType3 = "application/json"      
  $headers3 = @{
      Authorization = 'Bearer ' + $authtoken
  };
  
  $d = $jsonObj | ConvertTo-Json;
  Invoke-RestMethod -Method PUT -Uri $url3 -ContentType $contentType3 -Headers $headers3 -Body $d;
  </code></pre>
  
  <p>What could be wrong here?</p>