PowerShell scripts inside predeploy.ps1 throw random "access to path denied" when attempting to move files

PowerShell scripts inside predeploy.ps1 throw random “access to path denied” when attempting to move files around in the deployed package which causes deployment to fail.

It will work for several deployments, and then it will start failing for a few. Eventually it will just start working again.

Is this because Octopus is still working with the package? I cannot find anyone else who has had this issue with PowerShell scripts in general.

Thanks,
Kenneth

When Octopus calls your PowerShell scripts it has already released all handles to the package, so there shouldn’t be any problem there. Is it possible that other software running on the machine (e.g., anti-virus software, IIS, etc.) might have taken a handle to some of the files preventing them from being moved?

Paul

Thanks Paul for the information. Something else may have a handle on it, but it is sporadic and rarely happens twice in a row; so, it is difficult to debug.

Now that I have your information, I try a few more things.

Thanks,
Kenneth