Create a second step that deploys a different script

I’m currently trying to create a second step in my deployment process where after the first step runs a powershell script inside a folder the second step should switch to a different directory outside of the first folder and run the script from there but I’m not sure how i would go about doing that.

Hi @sabrina.grosse,

Thanks for reaching out, and I would be happy to help with your questions on scripting/execution in Octopus Deploy!

As an initial step, I wanted to link our baseline documentation on this topic for your review/reference, in case you haven’t come across this yet.

Generally speaking, you should be able to accomplish what you want to do using the Run a Script step and supplying your code/logic as needed, similar to the following (using a Deploy a Package step first):


If you need to access specific file paths related to the initial step, we have various system variables for this (i.e., Octopus.Action[Deploy a Package].InstallationDirectoryPath).

And the following documentation covers how you can reference these special variables within your custom scripts.

I hope this initial information helps, but let me know if I can be of any more assistance.



This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.