Retrieve list of actions for a deployment using Powershell

I am trying to run a powershell script step that iterates through all of the actions for the current deployment. Here is the code:

$actions = $OctopusParameters['Octopus.Action']
foreach ($a in $actions) { ... }

The list of actions is always empty. I have been able to iterate through the actions in an email step using #{each action in Octopus.Action} . How can I do this in powershell?

Ok, I didn’t realize that same code would work in powershell. Here is the solution I used:

#{each action in Octopus.Action}
   Write-Host "#{action}"
#{/each}

Marking this as closed.

1 Like