Deploy.ps1 not containing variables?

One of my processes is a powershell script that returns a variable:
Set-OctopusVariable -name "MySecretValue" -value $mySecretValue

Later on I have another process that deploys a nuget package that contains a Deploy.ps1 file. This file should be able to read the above mentioned variable. I do not want to store this value anywhere (so no app settings!). I thought this would be possible with:
$mySecretValue = "#{Octopus.Action[Create Variables].Output.MySecretValue}"

But the value does not seem to be replaced. Why?

Is there any way I can send an argument to Deploy.ps1 without permanently saving it?



Thanks for getting in touch. Unfortunately at this point we don’t do variable substitution on Deploy scripts in your package. We do however add variables to the PowerShell scope, so you should be able to achieve the same thing with:

$mySecretValue = $OctopusParameters["Octopus.Action[Create Variables].Output.MySecretValue"]


Fixed. Thanks!

Van: Mark
Verzonden: Thursday, April 6, 2017 23:04
Aan: Tijs
Onderwerp: Re: Deploy.ps1 not containing variables? [Problems #53296]