Capture Powershell script output


I’ve got a deployment step that runs inline Powershell script. How can I extract the whole script output and store it into output variable or file or somewhere else?

Thank you,

Hi @d.zamakhov, thanks for reaching out.

The Octopus.Action[Step Name].Script.ScriptBody variable contains the inline script value.

You can find the variables available to a step by setting the OctopusPrintEvaluatedVariables Octopus variable to True. These variables are documented at

The screenshot below shows these variables listed in the verbose logs for a script step.