I have inherited an Octopus deploy env, so I apologize if this is a simple question. We have a step that runs a powershell script that use #{hostip} as a variable. When I look in Octopus the variable has two values. 10.1.0.1 and 10.1.0.2. What seems to be happening is that when Octo deploy runs its evaluates that #{hostip} variable and grabs the last one it reads, so we are getting a duplicate IP. 10.1.0.2 is being assigned by the script.
I was told this worked before, but I cant see how. Any thoughts?
Thanks for getting in touch! Are these split into separate values, or are they comma-separated values in the same variable? In the latter, I set up a quick test and successfully written both values with the following (confirming the syntax in this doc page).
$multiVal = "#{each host in hostip} - #{host}#{/each}"
Write-host $multiVal