Customize Buttons

Being relatively new to PowersShell I’m a lost. I have manage to customize most of my form bot would like to remove the “Continue” button and move over the “Defer” button in its place. This is what my form looks like so far;

As you can see, I only want to present my users with the option to close and continue or Postpone (Defer).

You’d have to change the “Location” for the desired button you’re working with. Like left, middle or right button within the function. So in the “AppDeployToolkitMain.ps1” file search for the prompt you’re using like “show-installationwelcome” and within that function search for the form buttons. Adjust the location as needed.
Which function are you using here?

Set your postpone button to the BottomRight location and it should overwrite the Run Now button.

Hey, where did you edit the text for the buttons?

I’m guessing your code is something like this:
Show-InstallationWelcome -CloseApps 'outlook' -AllowDefer -DeferTimes 3

As for modifying the GUI, Show-InstallationWelcome uses the Show-WelcomePrompt function to actually display the GUI.

The text for the [Defer] Button is contained inside $configClosePromptButtonDefer as per this line:
$buttonDefer.Text = $configClosePromptButtonDefer

The text for the [Close Apps] Button is contained inside $configClosePromptButtonClose as per line:
$buttonCloseApps.Text = $configClosePromptButtonClose

The contents of both $configClosePromptButtonDefer and $configClosePromptButtonClose are set via the XML file using this code near the beginning of AppDeployToolkitMain.ps1:

[string]$configClosePromptButtonClose = $xmlUIMessages.ClosePrompt_ButtonClose
[string]$configClosePromptButtonDefer = $xmlUIMessages.ClosePrompt_ButtonDefer

If you can understand all this, you will notice the surrounding code in the Show-WelcomePrompt function that will allow you to move and remove the buttons as you wish.