Jul 042017
 July 4, 2017  Posted by at 9:22 am Dev Ops, PowerShell  Add comments

We recently moved our environments to new virtual machines, and decided to reinstall and set up Octopus Deploy from scratch. We also used this opportunity to change some of the deploy steps so we could benefit from the new features in Octopus Deploy. Octopus Deploy has a long list of variables that simplifies the steps (if used correctly) – and also helps making the steps more generic.
However, they are confusing, and I’m never 100% sure which one I need and the simplest way to sort this out is by printing out all of them (key and value) in combination with the documentation.

Simply add a script step in your release, preferably as a part of a step where you need the variables. Iterate through the variables using PowerShell, printing key and value and once run the output will be visible in the release log result.

2017-07-05_18-16-41 2017-07-05_18-17-12

A loooong list of variables. I copied the list and saved it in my OneNote, with some notes about the state of the release and NuGet package that was released so I have some context.

foreach ($key in $OctopusParameters.Keys){
$value = $OctopusParameters[$key]
echo "$key $value"

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



What is 5 + 13 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)