I am deploying a dependency in Intune that requires a restart, so that an application can be installed immediately after restart. I have successfully deployed the dependency and chained it with the app, so the user can start the app install, and Intune installs the dependency and prompts for restart, and the app installs afterwards. My problem is, when using Show-InstallationRestartPrompt, Intune is not waiting until the restart prompt times out or is interacted with before running the next app. Essentially Intune sees the dependency as installed before the restart prompt resolves. In PSADT I’m using:
Show-InstallationRestartPrompt -CountdownSeconds 600
I’m also using a custom detection script with registry queries in Intune. What is the best way to ‘hang up’ PSADT until the user click restart, or the prompt times out? I’d like to avoid Start-Sleep calls if I can. Maybe somehow create a file when the restart prompt is done and add that into the detection script?