Question - Error popup / Countdown


I’m still relatively new when it comes to the PSADT. A couple questions regarding the GUI. Ive checked the documentation and couldn’t find anything so I thought I would ask.

  1. If the script for some reason fails during the installation, is it possible for a popup to display letting the users know that the installation failed and to call the helpdesk to get the issue resolved?

  2. I would like to let the users know how long the installation will take. Right now I usually just blast out an email before I deploy something but I was wondering what other people do. Is it possible to have some kind of countdown happening till the installation is complete?

I am currently using the interface to prompt the user to close specified applications and the progress message display letting the users know that the application is uninstalling/installing.



you can use the Show-InstallationWelcome with -CustomText parameter, where you can put the information about how long the installation will take. You can also just use Show-InstallationPrompt with just the OK button.

For the custom failure message you would need to do more work as when it “fails” is not as easy to check. First, you need to change message in Deploy-Application.ps1

Show-DialogBox -Text $mainErrorMessage -Icon 'Stop'

$mainErrorMessage contains the error message currently but there is Write-Log above that logs it as well so you can just replace this variable with some text you want to display to your users that the installation failed and that they need to contact helpdesk. Can also keep the variable in with the message - Up to you. This will help with all error message except from Execute-Process and Execute-MSI functions as that requires you to use parameter ExitOnProcessFailure so the function doesnt exit the script on bad exit code.

Thanks @luki1412, I appreciate the response.

If anyone has any pics of their custom welcome screen/error dialog box they created and would be willing to share, that would be awesome. I’m planning on spending some more time on this next week.

Thanks again!