Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Powershell Remove-Item cmdlet fails only when deployed

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.

0

Comments

3 comments
Date Votes