Hi,
We have been using PSADT for a good number of years however, we are seeing strange errors recently when deploying via intune:
[Asynchronous] :: Failed to delete folder(s) and file(s) from path [C:\WINDOWS\SystemTemp\(our company name)\BlockExecution].
Error Record:
-------------
Message : Cannot remove item C:\WINDOWS\SystemTemp\(our company name)\BlockExecution\AppDeployToolkitBanner.png: The
process cannot access the file 'AppDeployToolkitBanner.png' because it is being used by another
process. Cannot remove item C:\WINDOWS\SystemTemp\(our company name)\BlockExecution: The directory is not
empty.
InnerException :
FullyQualifiedErrorId : Cannot remove item
C:\WINDOWS\SystemTemp\(our company name)\BlockExecution\AppDeployToolkitBanner.png: The process
cannot access the file 'AppDeployToolkitBanner.png' because it is being used by another
process. Cannot remove item C:\WINDOWS\SystemTemp\(our company name)\BlockExecution: The directory is
not empty.
ScriptStackTrace : at Remove-Folder<Process>,
C:\WINDOWS\SystemTemp\(our company name)\BlockExecution\AppDeployToolkitMain.ps1: line 5064
at Unblock-AppExecution<Process>,
C:\WINDOWS\SystemTemp\(our company name)\BlockExecution\AppDeployToolkitMain.ps1: line 8826
at <ScriptBlock>, C:\WINDOWS\SystemTemp\(our company name)\BlockExecution\AppDeployToolkitMain.ps1:
line 16916
PositionMessage : At C:\WINDOWS\SystemTemp\(our company name)\BlockExecution\AppDeployToolkitMain.ps1:5064 char:21
+ Throw $ErrorRemoveFolder
Sometimes as well the PSADT .ico we use cannot be found either.
retries seem to resolve the issue and it does not happen on all devices. Not sure why we are seeing this.