Powershell scripts not extracted by nuget package deployment step

I am trying to use the PostDeploy script and have included the PostDeploy.ps1 file in my package.
However, tentacle does not extract this file from the package.
I attach screenshots of the deployment folder and the nuget package content, which clearly shows that the ps1 file has not been extracted.

Hi Alex,

Thanks for getting in touch! Just as a starting point to troubleshoot this, generally when something like ‘my files are not being released’ occurs it is due to package cache.
We cache both on the Octopus Server and on the Tentacle, so if you have made changes to your package but not given it a new version and also not created a new release this would occur.

Can you confirm it is a new package version and a new release?


Yes, this is a new package and I checked the package content on the tentacle and can confirm that it contains the Powershell script file:

However, as you can see, the deployment folder does not contain this file. It only has dll, exe and config files:

Hi Alex,

We also cache on the Tentacle side. Can you send me a deployment log?

We extract everything there is no way for us to not extract something. When I say new package, I mean new package version as well as new release needs to be created when you add files.



The screenshot was made on the deployment machine, on the tentacle side.

In the Tentacle folder I found three versions of this package:

I checked all of them and found that in 0132 has no .ps1 file and two other packages (133 and 134) do have it.

I have checked the logs (attached) and I see two things:

  1.  The wrong package is taken (133 instead of 134) 
  2.  The package 133 contains the .ps1 file but is has not been extracted

I am quite confused now since I see that the package names on tentacle are possibly not matching the library package names, is this correct?

ServerTasks-3255.log.txt (11 KB)

I removed all previous version of both packages and application deployments and run the deployment again. The log shows there are no previous versions found. The version that is deployed is the correct one.

I renamed the package file to .zip file and looked into it.

The result:

  1.  The package clearly contains the PostDeploy.ps1 file
  2.  The file is not extracted to the application folder
  3.  The post deploy script is not executed as part of the deployment as expected


OK, I found it. The PostDeploy.ps1 is not extracted by Octopus Deploy but it was executed. I was sure it should be in the deployment folder. My script was empty and therefore I could not see that it was executed. That’s my fault, sorry about that.

There is no issue there.



Hi Alex,

Great to see you figured it out, I would suggest the 0kb filesize was probably the key.
Definitely when you are doing this kind of script testing adding something very simple like Write-Host "Hello World" will give you the best idea of execution.