Run condition variable check not working. Need a syntax check

I’m using a variable based run condition for the first time, and need a sanity check.
I’m setting up a step in my deployment to check for free disk space, and to pause if there’s not enough room to deploy.

Step 1 checks for disk space, and sets a variable
Set-OctopusVariable -name “LowDiskSpace” -value “True”

Step 2 is a pause step, and uses a run condition to determine if it should run. I can’t get this to work, and I’m sure that’s just a silly syntax error.
Here’s a few of the things I’ve tried.
#{if LowDiskSpace}#{/if} (Never pauses)
$LowDiskSpace (Always pauses)
$OctopusParameters[“Octopus.Action[Disk space check].Output.LowDiskSpace”] (Always pauses)

Can anyone tell what I’m doing wrong?

Hi,

Thanks for reaching out! When you use Octopus variables in Custom Expression fields (like the one for run condition), you should use the variables in its #{variable} form and not in its $Octopusparameter["variable"] one. The 2nd one should only be used in Powershell scripts.

That said, by simply putting #{Octopus.Action[Disk space check].Output.LowDiskSpace} in that fields you should be good to go (check attached screenshot).

If the variable resolves to true or 1, the step will run. If the variable is resolved to anything else, it won’t run.

Let me know how that goes,
Dalmiro

That worked perfectly. Thank you, Dalmiro!