Prompted Variables are not being filled with values

I am using Octopus 3.14.159.
I setup a prompted variable (test_user) which prompts me for a value when I deploy a release.
As a test I created a “Run a Script” step process. The script is in PowerShell and reads:
Write-host $test_user
I look at the log output for the deployment and there is never any output written to the log for variable “test_user”.
What am I doing wrong?

Hi Ron,

Thanks for getting in touch!

I think I understand what has gone wrong here. When you are referencing Octopus variables from within PowerShell scripts the variable formatting is different to standard as we parse these variables within Octopus prior to execution of the scripts. The format that you need to be able to reference an Octopus variable (of this type) is write-host #{test_user}.

If you are interested in learning more about how Octopus variables can be used we have some documentation that you might find useful here.

As for reviewing the logs for variables I can understand your confusion here where no variables are printed to the logs. By default logging variables is disabled as it would increase the size of the log files (quite significantly) and would also slow down deployments. To enable this feature please follow the instructions as outlined here.

I hope this helps, please let me know if there is anything else we can help you with!

Regards,

Alex

Vanessa Love pointed out that I was on a version of Octopus Deploy where prompted variables are broken. I am going to upgrade to the latest version and try again.
https://github.com/OctopusDeploy/Issues/issues/3600

Hi Ron,

Thanks for letting me know! Please get in contact if there is anything else we can assist with,

Regards,

Alex

The upgrade did the trick.