Show-InstallationRestartPrompt not waiting in Intune

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?

This is an Intune issue

As you have suggested, you could try a detection script but it would need to detect a change that occur upon reboot. you could use the RunOnce key in HKLM in the Pre-Req package to create a file upon reboot.

I tend to bundle the dependencies inside the package that need them and avoid all this “Fun”.

1 Like