Creating variable-set programmaticaly

hi All
i have to create at least 150 variable-sets and I want to do it with powershell
it is the same for creating tenants.

I am searching the right syntax to do it
Any idea?
thanks a lot
Ernesto Leite

Hi Ernesto,

Thanks for reaching out! If you are planning to use Powershell, I recommend you to give Octoposh a try.

Creating a Tenant

$Tenant = Get-OctopusResourceModel -Resource Tenant
$Tenant.Name = "MyNewTenant"
New-OctopusResource $Tenant

You can check the $Tenant object and its properties/methods using intelisense to learn how to add projects/environments to it before piping it to New-OctopusResource

Creating a Library variable set

$library = Get-OctopusResourceModel -Resource LibraryVariableSet
$library.Name = "MyVariableSet"
New-OctopusResource -Resource $library

You can check the $library object and its properties/methods using intelisense to learn how to add variables to it before piping it to New-OctopusResource

Best regards,
Dalmiro