Enable one to be able to iterate a list of last installed directory paths for steps in project
Create an Octopus variable that contains the last installed directory paths for the steps in the project. This becomes useful if you have one step that deploys and another that works on the previously deployed step, but for some reason you deployed one set of steps first and later the remaining steps.

-
Anonymous commented
Achieved the above using the following:
$KeyExpressions = @(
"*.Output.Package.InstallationDirectoryPath",
"*.Package.CustomInstallationDirectory")$OctopusParameters.GetEnumerator() | % {
foreach ($KeyExpression in $KeyExpressions)
{
if ($_.key -like $KeyExpression)
{
Write-Host ""
Write-Host "Key: $($_.key)"
Write-Host "Value: $($_.value)"# do what you want here...
}
}
}