PSD icon indicating copy to clipboard operation
PSD copied to clipboard

Install Applications via PowerShellappdeploykit (PSADT) - task sequence gets stuck during installation

Open TheBronco2410 opened this issue 9 months ago • 6 comments

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.

Image

Image

Image

Has anyone had experiences with psadt and psd? Does %DEPLOYROOT% work?

TheBronco2410 avatar Apr 04 '25 12:04 TheBronco2410

I have use PSAdt v3 with both mdt and PSD. I have not tried the new v4 version. Which one are u using?

PowerShellCrack avatar Apr 04 '25 17:04 PowerShellCrack

I only use v3

TheBronco2410 avatar Apr 15 '25 09:04 TheBronco2410

A Few things....

  1. 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'

  2. 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.

  3. I also noticed your installing the user installer. Did you mean to do that or use the machine-wide installer?

PowerShellCrack avatar Apr 23 '25 21:04 PowerShellCrack

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 avatar Apr 30 '25 07:04 TheBronco2410

@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

trongtinh1212 avatar May 11 '25 17:05 trongtinh1212

@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

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.

Xavierstarr avatar Jun 12 '25 02:06 Xavierstarr

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.

TheBronco2410 avatar Jul 04 '25 08:07 TheBronco2410