Octopus.Tentacle.CurrentDeployment.PackageFilePath is not being set

I have a deployment system set up to use an external feed. I have a post-deploy step where I need to know where that package is coming from. However, when I reference Octopus.Tentacle.CurrentDeployment.PackageFilePath, I get a null value. Here is the relevant code (note that the $release variable is being written correctly):

$release = ("/build:" + $OctopusParameters[“Octopus.Release.Number”].ToString())
$path = ($OctopusParameters[“Octopus.Tentacle.PreviousInstallation.PackageFilePath”].ToString())

Write-Host "Release " $release
Write-Host "File Path " $path

Hi Robert,

Thanks for reaching out.

The code you pasted shows you’re using the variable PreviousInstallation.PackageFilePath instead of CurrentDeployment.PackageFilePath.

When you say you have a post-deploy step, you mean you added a post-deploy script on the deployment step? cause that is the only way it’ll work, as the variable CurrentDeployment.PackageFilePath is only available inside the deployment step.

On the attached screenshot I used the following code inside the post-script field on the deployment step. Check the results screenshot too to see if that is the result you were looking for

$release = ("/build:" + $OctopusParameters["Octopus.Release.Number"]) 
$path = ($OctopusParameters["Octopus.Tentacle.CurrentDeployment.PackageFilePath"])

Write-Host "Release " $release 
Write-Host "File Path " $path

Thanks!

Dalmiro