I've got a Powershell script that stops a process and then removes the folders for where that software lives using the Remove-Item cmdlet. When running this locally on the machine it works. When attempting to do this via PDQ Deploy, it fails with a permissions error stating that "Access to the path is denied". However, the deploy user has rights to the directories mentioned. We're using the -Force flag as well.
I was suspecting that the process was not terminating and access was being denied due to the files being in use, however sending a Powershell command to kill the process (without removing any files) is successful via PDQ.