title: Register-Environment Failing
body: <p>I am having trouble creating a release definition on Azure DevOps. I believe the Register-Environment function in PowerShellOnTargetMachines.ps1 is failing:</p>
  
  <pre><code>try
  {
      $connection = Get-VssConnection -TaskContext $distributedTaskContext
  
      Write-Verbose "Starting Register-Environment cmdlet call for environment : $environmentName with filter $machineFilter"
      $environment = Register-Environment -EnvironmentName $environmentName -EnvironmentSpecification $environmentName -UserName $adminUserName -Password $adminPassword -WinRmProtocol $protocol -TestCertificate ($testCertificate -eq "true") -Connection $connection -TaskContext $distributedTaskContext -ResourceFilter $machineFilter
      Write-Verbose "Completed Register-Environment cmdlet call for environment : $environmentName"
  
      Write-Verbose "Starting Get-EnvironmentResources cmdlet call on environment name: $environmentName"
      $resources = Get-EnvironmentResources -Environment $environment
  
      if ($resources.Count -eq 0)
      {
          Write-Telemetry "Input_Validation" "No machine exists for given environment"
          throw (Get-LocalizedString -Key "No machine exists under environment: '{0}' for deployment" -ArgumentList $environmentName)
      }
  
      $resourcesPropertyBag = Get-ResourcesProperties -resources $resources
  }
  </code></pre>
  
  <p>With the following error (I have omitted some of my organization's information, but it is there and looks right):</p>
  
  <pre><code>2019-09-04T12:34:55.6886629Z ##[debug]VssConnection created
  2019-09-04T12:34:55.7518340Z ##[debug]Starting Register-Environment cmdlet call for environment : [machine] with filter [machine]
  2019-09-04T12:34:55.7843531Z ##[debug]Begin Create-Environment cmdlet
  2019-09-04T12:34:55.7872731Z ##[debug]UserName=[username]
  2019-09-04T12:34:55.7878292Z ##[debug]WinRmProtocol=HTTP
  2019-09-04T12:34:55.7878658Z ##[debug]TestCertificate=False
  2019-09-04T12:34:55.7878965Z ##[debug]Unable to create a environment object for given json - Unexpected character encountered while parsing value: A. Path '', line 0, position 0.
  2019-09-04T12:34:55.7879241Z ##[debug]projectName=[projectName]
  2019-09-04T12:34:55.7879517Z ##[debug]Getting environment [machine] from DTL Service
  2019-09-04T12:34:55.8485808Z ##[debug]Processed: ##vso[task.logissue type=error;code={"Task_Internal_Error":Page not found.};]
  </code></pre>
  
  <p>And I do not know what to do. Any ideas are appreciated. Thanks for taking the time to read my question.</p>