However, this repeatedly gives an ArgurmentOutOfRange exception. Googling a bit lead me to Paul’s Gists on invoking ScriptCS scripts from which I figured out one can use named parameters using Octopus.Paramters[“parameterName”].
Our docs already has an example under the Variables that shows to use Octopus.Parameters["parameterName"] syntax when running a ScriptCS script.
The sample that uses Env.ScriptArgs is located under the Passing parameters to scripts section which has an info box under with specifying You can use script parameters for file-based scripts that are sourced from a package.