Script file inside a package variable substitution

Hi,

I am currently testing 3.3 and have tried to perform variable substitution while using “Script file inside a package”. I don’t see the variables being substituted nor do I see an option in the Process to allow me to substitute them.

Could you confirm whether this is a bug or intended behaviour?

Thanks
Ken

Hi Ken,

Thanks for getting in touch. I did a simple test with the script below and it worked fine. Can you tell me if you were using beta 1 or 2 and tell me a bit more about the script you were using?

Script:

$machineName = $OctopusParameters['Octopus.Machine.Name'];
$var1 = $OctopusParameters['Var1'];
Write-Host "Testing a package script running on: $machineName w/ a variable: $var1."

Output: Testing a package script running on: tentacle 01 w/ a variable: Value1.

Looking forward to your reply.

Rob

Hi Rob,

Thanks for the reply! I see now – I have made a mistake and didn’t spot the documentation on variables in scripts (http://docs.octopusdeploy.com/display/OD/Custom+scripts). I had assumed to use the #{variable} syntax.

Thanks,
Ken