2.4: Scripts in sub folders will not be executed

I have PostDeploy.ps1 & PreDeploy.ps1 scripts that are located in the root of my folder, but I’m still seeing this message

“The script file “./PostDeploy.ps1” contained within the package will not be executed because it is contained within a child folder. As of Octopus Deploy 2.4, scripts in sub folders will not be executed.”

The message itself seems to indicate that the PostDeploy.ps1 is in the right place, since it doesn’t list a subfolder in front of PostDeploy.ps1.

I’m on OD 3.4.6


Thanks for reaching out! When the deployment process is searching for deploy scripts, it’ll search everywhere in the package. If it finds a deploy script with the same name in child folders, it will cause this error even if a script exists in the parent directory. I think that’s what is happening. Would you mind checking if you have additional deploy scripts lingering somewhere in your package?

Let me know how you go!