Output Variables not scoped to specific step

Is it possible to use Set-OctopusVariable so that I don’t need to know the step name that created it in order to access it?

E.g. if I have step “Deploy Package” and within that step I call Set-OctopusVariable -name "MyVar" -value "foo". If I want to access this value in subsequent steps I need to use the syntax $OctopusParameters["Octopus.Action[Deploy Package].Output.MyVar"].

Is it possible to somehow call Set-OctopusVariable but at a project/release level? Which would then enable me to use $OctopusParameters["Octopus.Action.Output.MyVar"] to access the value in subsequent steps?

Hi Donald,

Unfortunately it is not currently possible to set the Output variable without a step name. The step name is primarily included to differentiate the same variable being set on different steps that run in parrallel. The outcome in that case is randomish. I suggest adding the suggetion it to our UserVoice site however.

In the meantime, you could iterate though all the keys in the $OctopusParameters collection and find the key that ends in Output.MyVar and use that.


Robert W