Hi,
I just ran into a problem where another PSAppDeployment installation left a file named ‘BlockExecution’ at the location C:\Windows\Temp\PSAppDeployToolkit.
The presence of this file prevented the creation of a folder with the same name, causing the entire installation to fail.
I solved this in the Deploy-Application.ps1, by adding a few lines:
if(Test-Path -Path "$env:temp\PSAppDeployToolkit\BlockExecution"){
$Temp = Get-Item -Path "$env:temp\PSAppDeployToolkit\BlockExecution"
If(!($Temp.PSIsContainer)){
Remove-Item -Path "$env:temp\PSAppDeployToolkit\BlockExecution" -Force
}
}
Maybe not the prettiest solution, but for now it works.
Maybe the main file needs to check if there’s a file present there with that name, if the creation of that folder fails, before trying to elevate.
Just wanted to drop this here, since I spent quite a bit of time figuring out what was causing the installation ot fail.
Kind regards,
Joël.