Show-ADTInstallationPrompt
SYNOPSIS
Displays a custom installation prompt with the toolkit branding and optional buttons.
SYNTAX
ShowCustomDialog (Default)
Show-ADTInstallationPrompt -Message <String> [-MessageAlignment <DialogMessageAlignment>]
[-ButtonRightText <String>] [-ButtonLeftText <String>] [-ButtonMiddleText <String>] [-Icon <DialogSystemIcon>]
[-WindowLocation <DialogPosition>] [-NoWait] [-PersistPrompt] [-MinimizeWindows] [-NoExitOnTimeout]
[-NotTopMost] [-AllowMove] [-Force] -Title <String> -Subtitle <String> [-Timeout <UInt32>]
[<CommonParameters>]
ShowInputDialog
Show-ADTInstallationPrompt [-RequestInput] [-DefaultValue <String>] -Message <String>
[-MessageAlignment <DialogMessageAlignment>] [-ButtonRightText <String>] [-ButtonLeftText <String>]
[-ButtonMiddleText <String>] [-Icon <DialogSystemIcon>] [-WindowLocation <DialogPosition>] [-PersistPrompt]
[-MinimizeWindows] [-NoExitOnTimeout] [-NotTopMost] [-AllowMove] [-Force] -Title <String> -Subtitle <String>
[-Timeout <UInt32>] [<CommonParameters>]
DESCRIPTION
Displays a custom installation prompt with the toolkit branding and optional buttons. Any combination of Left, Middle, or Right buttons can be displayed. The return value of the button clicked by the user is the button text specified. The prompt can also display a system icon and be configured to persist, minimize other windows, or timeout after a specified period.
EXAMPLES
EXAMPLE 1
$result = Show-ADTInstallationPrompt -Message 'Do you want to proceed with the installation?' -ButtonLeftText Yes -ButtonRightText No
switch ($result)
{
Yes {
Write-ADTLogEntry "User clicked the [Yes] button."
}
No {
Write-ADTLogEntry "User clicked the [No] button."
}
}
EXAMPLE 2
Show-ADTInstallationPrompt -Title 'Funny Prompt' -Message 'How are you feeling today?' -ButtonLeftText 'Good' -ButtonRightText 'Bad' -ButtonMiddleText 'Indifferent'
EXAMPLE 3
Show-ADTInstallationPrompt -Message 'You can customize text to appear at the end of an install, or remove it completely for unattended installations.' -ButtonLeftText 'OK' -Icon Information -NoWait
EXAMPLE 4
Show-ADTInstallationPrompt -RequestInput -Message 'Tell us why you think PSADT is the best thing since sliced bread.' -ButtonRightText 'Submit'
EXAMPLE 5
Show-ADTInstallationPrompt -RequestInput -DefaultValue 'XXXX' -Message 'Please type in your favourite beer.' -ButtonRightText 'Submit'
PARAMETERS
-RequestInput
Show a text box for the user to provide an answer.
Type: SwitchParameter
Parameter Sets: ShowInputDialog
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-DefaultValue
The default value to show in the text box.
Type: String
Parameter Sets: ShowInputDialog
Aliases:
Required: False
Position: Named
Default value: [System.Management.Automation.Language.NullString]::Value
Accept pipeline input: False
Accept wildcard characters: False
-Message
The message text to be displayed on the prompt.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: [System.Management.Automation.Language.NullString]::Value
Accept pipeline input: False
Accept wildcard characters: False
-MessageAlignment
Alignment of the message text.
Type: DialogMessageAlignment
Parameter Sets: (All)
Aliases:
Accepted values: Left, Center, Right
Required: False
Position: Named
Default value: Center
Accept pipeline input: False
Accept wildcard characters: False
-ButtonRightText
Show a button on the right of the prompt with the specified text.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: [System.Management.Automation.Language.NullString]::Value
Accept pipeline input: False
Accept wildcard characters: False
-ButtonLeftText
Show a button on the left of the prompt with the specified text.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: [System.Management.Automation.Language.NullString]::Value
Accept pipeline input: False
Accept wildcard characters: False
-ButtonMiddleText
Show a button in the middle of the prompt with the specified text.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: [System.Management.Automation.Language.NullString]::Value
Accept pipeline input: False
Accept wildcard characters: False
-Icon
Show a system icon in the prompt.
Type: DialogSystemIcon
Parameter Sets: (All)
Aliases:
Accepted values: Application, Asterisk, Error, Exclamation, Hand, Information, Question, Shield, Warning, WinLogo
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WindowLocation
The location of the dialog on the screen.
Type: DialogPosition
Parameter Sets: (All)
Aliases:
Accepted values: Default, TopLeft, Top, TopRight, TopCenter, Center, BottomLeft, Bottom, BottomRight, BottomCenter
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-NoWait
Presents the dialog in a separate, independent thread so that the main process isn't stalled waiting for a response.
Type: SwitchParameter
Parameter Sets: ShowCustomDialog
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-PersistPrompt
Specify whether to make the prompt persist in the center of the screen every couple of seconds, specified in the config.psd1 file. The user will have no option but to respond to the prompt.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-MinimizeWindows
Specifies whether to minimize other windows when displaying prompt.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-NoExitOnTimeout
Specifies whether to not exit the script if the UI times out.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-NotTopMost
Specifies whether the prompt shouldn't be topmost, above all other windows.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-AllowMove
Specifies that the user can move the dialog on the screen.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Force
Specifies whether the message box should appear irrespective of an ongoing DeploymentSession's DeployMode.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Subtitle
Subtitle of the prompt. Optionally used to override the subtitle defined in the strings.psd1 file.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Timeout
Specifies how long to show the message prompt before aborting.
Type: UInt32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Title
Title of the prompt. Optionally used to override the active DeploymentSession's InstallTitle value.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
None
You cannot pipe objects to this function.
OUTPUTS
None
This function does not generate any output.
NOTES
An active ADT session is NOT required to use this function.
Tags: psadt
Website: https://psappdeploytoolkit.com
Copyright: (C) 2025 PSAppDeployToolkit Team (Sean Lillis, Dan Cunningham, Muhammad Mashwani, Mitch Richters, Dan Gough).
License: https://opensource.org/license/lgpl-3-0
RELATED LINKS
https://psappdeploytoolkit.com/docs/reference/functions/Show-ADTInstallationPrompt