阅读八达通变量

时间:2016-02-01 05:08:16

标签: powershell octopus-deploy octopus

我是章鱼新手并且有很多步骤。对于每个步骤,我们都有“机器角色”。

作为步骤的一部分,我有一个脚本任务/步骤,我希望在(powershell)脚本中访问分配给此步骤的角色。我怎样才能做到这一点。

我尝试了一些东西,即(powershell)脚本中的Octopus.Machine.Roles,Octopus.Tentacle.CurrentDeployment.TargetedRoles。但是没有看到任何东西。

1 个答案:

答案 0 :(得分:3)

this example中所示,如果Octopus中有变量,则可以使用变量名称访问它,前缀为PowerShell中的$,因此对于变量TestUrl使用:

$TestUrl

对于八达通参数,您可以使用以下内容:

$OctopusParameters['Octopus.Machine.Roles']

这可以让您访问所有system variables