1

I am new to octopus and have a bunch of steps. For each steps we have "Machine Roles".

As part of the steps I have a script tasks/step and I wish to access the roles assigned to this step in the (powershell) script. How can I achieve this.

I tried a few things, i.e. Octopus.Machine.Roles, Octopus.Tentacle.CurrentDeployment.TargetedRoles in the (powershell) script. But does not see anything.

Immortal
  • 1,233
  • 4
  • 20
  • 47

1 Answers1

3

As found in this example, if you have a variable in Octopus, you can access it using the variable name, prefixed with a $ in PowerShell, so for a variable TestUrl use:

$TestUrl

For Octopus Parameters, you use the following:

$OctopusParameters['Octopus.Machine.Roles']

This should give you access to all the system variables.

Fenton
  • 241,084
  • 71
  • 387
  • 401