Timeout in Show-ADTInstallationPrompt

Is there a way how to display the timeout in Installation Prompt?

E.g.:

Show-ADTInstallationPrompt -Message "Uninstallation of XXX is starting. The uninstallation process will start in $timeout seconds. You can speed it up by pressing OK." -ButtonRightText 'OK' -Timeout 100

But the variable $timeout obviously does not work...

I have just tried this using the following cmd line (slightly modified from yours):

$timeout = 100
$Title = "Uninstalling XXX"
$Subtitle = "Now!"
Show-ADTInstallationPrompt -Message "Uninstallation of XXX is starting. The uninstallation process will start in $($timeout) seconds. You can speed it up by pressing OK." -ButtonRightText 'OK' -Timeout $timeout -Title $Title -Subtitle $Subtitle


After 100 seconds the screen closes automatically, so it seems to work as a single command.

You may need to define the timeout within the ADTSession variables

I'm not certain, but I think this sounds similar to this issue

1 Like

Thanks for your input.

I think I didn't put my question correctly. I don't want this to be static information (I can do that easily directly in the parameters) but I want this to be dynamic value (a countdown) showing how much time is left before the window is closed and the installation continues.

Just like countdown in Show-ADTInstallationRestartPrompt

Ah!

I think you want to be using Show-ADTInstallationWelcome
See the -ForceCountdown switch:

You may want to include other switches such as -AllowDefer so the user can be given the option to postpone the uninstall until a more convenient time

1 Like

You can't just reference internal function variables like that and expect it to work. Adrian's suggestion of Show-ADTInstallationWelcome is the correct approach here.

2 Likes

You are right. Using the Show-ADTInstallationWelcome function did the trick. I overlooked the parameter -ForceCountdown.

Thanks!

3 Likes

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