Hi,
I am adding a new Library Variable Set via a powershell script and I am seeing the following error when I add an Environment to the scope:
It adds the Environment no problem when I add it manually. Any idea why this would be happening??
I’m wondering if it is somehow retrieving the wrong environment-id when adding the scope.
After running your script to add the variable, if you also manually add a value with environment scope so that the variable has a mix of both working and not working values.
Then retrieve the variable set using <octopusURL>/api/Spaces-1/variables/variableset-Projects-21
You’ll need to replace the project ID at the end, you can retrieve this using <octopusURL>/api/Spaces-1/projects
You’ll then be able to compare the environment IDs assigned to the values.
e.g.