Script Parameters

Published on: 13 Jul 2016 by: Pawel Pabich

We have extended standalone scripts so now you can pass command line parameters to them.

Before this feature you had to write "Octopus" scripts which used the Octopus API to get variable values, like $OctopusParameters["MyValue"] in PowerShell. This makes it hard to test your scripts outside of Octopus.

Otherwise you could write an additional "wrapper" script which used the Octopus API to get variable values and pass those as parameters to your "normal" scripts. Now it was easier to test your "normal" scripts outside of Octopus, but you needed to manage additional files.

In Octopus 3.3.21 none of this is necessary and you can parameterize your scripts without needing any those workarounds.

Script parameters

Parameters need to be provided in a language specific way. E.g. -Parameter1 Value1 -Parameter2 Value2 for PowerShell or Value1 Value2 for Bash. This is important because we take them as they are and pass them to the appropriate execution environment. Pseudo code: scriptrunner script parameters.

Octopus Deploy is used by thousands of developers across the globe, from small companies to large enterprises. Find out if it meets your deployment automation needs by taking advantage of our free 30-day trial. You can spin up an instance with just a few clicks!