Show-InstallationRestartPrompt - not displayed when deployed via sccm

Hi,

I’m using PSADT for years now in all my app deployments.

Now I have to make use of the Show-InstallationRestartPrompt function to prompt for a reboot before the last part of the script can continue.

What I’m trying to use is this:

Show-InstallationRestartPrompt -NoCountdown

Anyway, the issue I’m facing is that the restart prompt is not displayed at all. But for instance the “Show-InstallationPrompt” with a custom message is displayed without problems as well as balloon tips.

Application settings are:

  • Installation program: “Deploy-Application.exe” -DeploymentType “Install” -DeployMode " Interactive " -AllowRebootPassThru
  • Installation behavior: “Install for system”
  • Logon requirement: Only when a user is logged on
  • Installation program visibility: Normal
  • “Allow users to view and interact with the program installation” is checked

As I mentioned, when I add other prompts and balloon tips, these are displayed nicely. So my “interactive” deployment is working. I’m just not sure why the restart prompt is not showing.

In the toolkit log file it says that it is displaying the prompt:

[Pre-Installation] :: Invoking Show-InstallationRestartPrompt asynchronously with no countdown...

But the prompt never shows.

I’m using PSADT 3.8.4

Any suggestions?

1 Like

Exact same issue here. Except I have my Show-InstallationRestartPrompt command in the [Post-Installation] section. Log seems to show everything is proper but the prompt NEVER shows!

[Post-Installation] :: PS_AppDeployToolkitMain_3.8.4_EN_01 Installation completed with exit code [3010]. Exit-Script 2/16/2021 4:05:14 PM 23544 (0x5BF8)
[Post-Installation] :: Check if PowerPoint is in either fullscreen slideshow mode or presentation mode… Test-PowerPoint 2/16/2021 4:05:14 PM 23544 (0x5BF8)
[Post-Installation] :: PowerPoint application is not running. Test-PowerPoint 2/16/2021 4:05:14 PM 23544 (0x5BF8)
[Post-Installation] :: PowerPoint is running in fullscreen mode [False]. Test-PowerPoint 2/16/2021 4:05:14 PM 23544 (0x5BF8)
[Post-Installation] :: Display balloon tip notification asynchronously with message [Installation complete. A reboot is required.]. Show-BalloonTip 2/16/2021 4:05:14 PM 23544 (0x5BF8)

It doesn’t matter in what section the prompt is. I’ve tried to move it in Post Install as well, but same issue.
The prompt never shows…

Show-InstallationRestartPrompt -NoCountdown doesn’t display restart prompt · Issue #617 · PSAppDeployToolkit/PSAppDeployToolkit (github.com)

Seen this yesterday.
I manually made these changes but it didn’t fix my issue. It’s still not showing.
Fix a bug in Show-InstallationRestartPrompt by dianneman · Pull Request #609 · PSAppDeployToolkit/PSAppDeployToolkit (github.com)

1 Like

Other fixes for these functions are also on their way: Nowait fixes for Show-InstallationRestartPrompt and Show-InstallationPrompt by luki1412 · Pull Request #622 · PSAppDeployToolkit/PSAppDeployToolkit (github.com)

1 Like

Thanks, but that’s too much.
I’ll just wait for the new release…

Tnx this modification fixed the issue for me.

The problem seems to be a change in 3.8.4 that uses Switch rather than If-Then-Else.
(line 7891 of AppDeployToolkitMain.ps1 that processes $installRestartPromptParameters)
The problem is that $_ is used, and the Switch function itself overwrites this dynamic variable.
In the end you just get a dash for each original parameter, and when this is feeded into the Start-Process on line 7908, you end up with "-ShowInstallationRestartPrompt - ", which makes the process crash (you get 2 Windows Error Reporting events (ID 1001) in the application event log).

Thanks, worked for me

Blockquote[quote=“pki-vdp, post:9, topic:3140, full:true”]
The problem seems to be a change in 3.8.4 that uses Switch rather than If-Then-Else.
(line 7891 of AppDeployToolkitMain.ps1 that processes $installRestartPromptParameters)
The problem is that $_ is used, and the Switch function itself overwrites this dynamic variable.
In the end you just get a dash for each original parameter, and when this is feeded into the Start-Process on line 7908, you end up with "-ShowInstallationRestartPrompt - ", which makes the process crash (you get 2 Windows Error Reporting events (ID 1001) in the application event log).
[/quote]

can you please explain how to fix this? Thanks!

You can put it back to the code that was used in 3.8.3 (line 7351).

So replace the switch block (line 7892-7905) with this code

				If ($_.Value.GetType().Name -eq 'SwitchParameter') {
					"-$($_.Key)"
				}
				ElseIf ($_.Value.GetType().Name -eq 'Boolean') {
					"-$($_.Key) `$" + "$($_.Value)".ToLower()
				}
				ElseIf ($_.Value.GetType().Name -eq 'Int32') {
					"-$($_.Key) $($_.Value)"
				}
				Else {
					"-$($_.Key) `"$($_.Value)`""
				}
6 Likes

Thanks this works! very helpful

This is very helpful. Many thanks. Hopefully they pick this up in the issues list and get it into the next version.

Show-InstallationRestartPrompt is not working at all. I copied the version from 3.8.3 into AppDeployToolkitMain.ps1 and it worked immediately.

Yep, this works well. Thanks for the fix.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.