Scope of Set-OctopusVariable

Greetings,

Is the scope of variables created with Set-OctopusVariable limited to the PreDeploy/Deploy/PostDeploy/DeployFailed from a single package?

I upgraded to 1.3.5.1564 and tried to use Set-OctopusVariable not in a nupkg but rather in a “Run a PowerShell script” step, and it does not seem to be accessible from later Run Powershell steps.

Hi Jordan,

You are correct.

Set-OctopusVariable only applies to the current package deployment. The reason is because a deployment in Octopus can span multiple machines. If two machines set conflicting values when calling Set-OctopusVariable, which one would we use?

If you wanted to store a setting for the same machine that set it, storing it locally on the machine (in the registry/file system) is probably the best option.

Paul