Using Octopus.Client to List all variables, values and Scope within one Variable Set

Hi Octopus team,

Is there a way to list a variable set’s variables, values and Scope by using Octopus.Client?
Would be appreciated if you can show me the powershell scripts for it.

Thanks.

Jian

Hi Jian,

Thanks for getting in touch! Yes there is a way, you can do this via the Octopus Deploy API. While we don’t have any pre-made PowerShell scripts for exactly this using Octopus.Client, we do have one which is mostly what you are after, using REST.

If you would like to use the REST API option.
https://github.com/OctopusDeploy/OctopusDeploy-Api/blob/master/REST

However, I would be happy to create one for Octopus.Client in the morning. In the mean time, I can provide you with some links with some similar examples and documentation to our API if you would like to try this yourself.

Below are some example scripts of using Octopus.Client & the API to interact with variables in Octopus.
https://github.com/OctopusDeploy/OctopusDeploy-Api/tree/master/Octo

I can also provide you with the link to our API wiki which has some information that will help you out here.


https://github.com/OctopusDeploy/OctopusDeploy-Api/wiki/LibraryVari

Again, I’m more than happy to write this up in the morning(AEST) if you need a hand here.

Best regards,
Daniel

Thanks Daniel,

I will take a look on the Rest API.

Hi Jian,

Great, Let me know if you run into any issues.

Best regards,
Daniel