Scripts fail due to file named PSAppDeployToolkit in folder C:\Users\Public\
Somehow a file named PSAppDeployToolkit was created instead of a folder in C:\Users\Public, believe this has something todo with -BlockExecution. Version I used when this occurred was 3.6.2, with the function get-runningprocess from 3.6.3.
To solve this I made the following addition to the deploy-application.ps1 file
If ($deploymentType -ine ‘Uninstall’) {
##===============================================
## PRE-INSTALLATION
##*===============================================
[string]$installPhase = ‘Pre-Installation’
<My code starts here
If (!(Test-Path -Path “C:\Users\Public\PSAppDeployToolkit” -PathType Container))
{
Remove-Item “C:\Users\Public\PSAppDeployToolkit”
}
ends here>
Error message is below!
[Pre-Installation] :: Error Record:
Message : Could not find a part of the path ‘C:\Users\Public\PSAppDeploy
Toolkit\AppDeployToolkit_BlockAppExecutionMessage.vbs’.
InnerException :
FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCo
mmand
ScriptStackTrace : at Block-AppExecution<Process>, C:\WINDOWS\ccmcache\9n
AppDeployToolkit\AppDeployToolkitMain.ps1: line 4421
at Show-InstallationWelcome<Process>, C:\WINDOWS\ccmcac
he\9n\AppDeployToolkit\AppDeployToolkitMain.ps1: line 5
195
at <ScriptBlock>, C:\WINDOWS\ccmcache\9n\Deploy-Applica
tion.ps1: line 110
at <ScriptBlock>, <No file>: line 1
at <ScriptBlock>, <No file>: line 1
PositionMessage : At C:\WINDOWS\ccmcache\9n\AppDeployToolkit\AppDeployToolkitMa
in.ps1:4421 char:26
+ $debuggerBlockScript | Out-File -FilePath "$dirAppD
eployTemp\AppDeployToolkit_ …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~