Install Applications via PowerShellappdeploykit (PSADT) - task sequence gets stuck during installation
When trying to install PowerToys as app with PowerShellappdeploykit (psadt), the task sequence gets stuck during the installation, even if the task is set on "continue on error". After manually closing the open ps-windows, the task sequence continues and finishes without any errors, but the program ist not installed.
The installation path is reachable and the installer ps1 works, all checked/tested manually. Or do I have to do set-executionpolicy? I dont have to do that with old MDT i believe.
Has anyone had experiences with psadt and psd? Does %DEPLOYROOT% work?
I have use PSAdt v3 with both mdt and PSD. I have not tried the new v4 version. Which one are u using?
I only use v3
A Few things....
-
Why is the Execute-Process calling the exe from an UNC share? Based on PSADT documentation, you should be copying the file to the PSADT's files folder, then calling directly (that folder is the default location). Something like:
Execute-Process -Path 'PowerToysUserSetup-0.90.1-x64.exe' -Parameters '/q' -
If you were to use UNC to install it, the local Admin would need access to that share. Keep in mind PSD does not work well with UNC shares. It will copy the contents from the deploymentshare via a web request and cache it, then call it from there.
-
I also noticed your installing the user installer. Did you mean to do that or use the machine-wide installer?
Sorry for the late reply. I removed the UNC to access it directly: Execute-Process -Path "$dirFiles\PowerToysUserSetup-0.90.0-x64.exe" -Parameters '/q' Same result. It gets stuck and nothing happens. If I execute the command or the script locally, it works just fine.
Yes, I just chose the user installer for test purposes, as long as this doesn't cause a problem? Eventually it is not very important for me which installer to use.
@TheBronco2410
few softwares will create sub-processes during installations, my workaround is edit PSDApplications.ps1 in Scripts
search for $result = Start-Process and you will see 2 lines with the results
Ok let's remove -Wait and replace with | Wait-Process
For example full line should be : $result = Start-Process -FilePath "$toolRoot\bddrun.exe" -ArgumentList $cmd -Passthru | Wait-Process and $result = Start-Process -FilePath "$toolRoot\bddrun.exe" -ArgumentList $cmd -WorkingDirectory $workingDir -Passthru | Wait-Process
@TheBronco2410 few softwares will create sub-processes during installations, my workaround is edit PSDApplications.ps1 in Scripts search for
$result = Start-Processand you will see 2 lines with the results Ok let's remove-Waitand replace with| Wait-ProcessFor example full line should be :$result = Start-Process -FilePath "$toolRoot\bddrun.exe" -ArgumentList $cmd -Passthru | Wait-Processand$result = Start-Process -FilePath "$toolRoot\bddrun.exe" -ArgumentList $cmd -WorkingDirectory $workingDir -Passthru | Wait-Process
Gave this a crack myself also this morning, Task Sequence still hangs when the PowerShell script finishes installing the executable but this time I can kill PowerShell processes in task manager after my custom script finishes and task sequence progresses, whereas before task sequence would just stop and need to manually run PSDFinal to wrap up the deployment.
Thanks for the help. I found the solution or workaround. I just changed the way I install the apps: I add them in the application tab within MDT with source files and use the deploy-application.exe as cmd line expression to install. Then I mention them in the Task sequence as install single application etc. Now it works.