> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/deployr/reference/step-definitions/show-message-box.md).

# Show message box

{% hint style="info" %}
Applies to: DeployR 1.4 and later.
{% endhint %}

The **Show message box** step displays a message box in the DeployR progress UI and waits until someone clicks one of its buttons. The button that was clicked is saved in a task sequence variable, so later steps can use it in their conditions. Use it to give the technician instructions or to ask a question that changes what the task sequence does next.

### Options

| Option          | Description                                                                                                                                                 |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Title           | Text in the title bar of the message box. Default: `DeployR`.                                                                                               |
| Message         | The message to display.                                                                                                                                     |
| Buttons         | **OK**, **OK, Cancel**, **Yes, No**, **Yes, No, Cancel**, **Retry, Cancel**, **Abort, Retry, Ignore**, or **Cancel, Try Again, Continue**. Default: **OK**. |
| Icon            | **None**, **Information**, **Question**, **Warning**, or **Error**. Default: **None**.                                                                      |
| Default button  | The button that has the focus and is clicked when Enter is pressed: first, second, or third. Default: first.                                                |
| Timeout         | Number of seconds to wait for a click. When the time runs out, the step continues with a result of `Timeout`. `0` waits indefinitely (the default).         |
| Result variable | Task sequence variable that receives the result. Default: `MessageBoxResult`.                                                                               |

The title and message can include task sequence variables using `%VARIABLE%` syntax, for example `Ready to deploy %ComputerName%?`.

### Result values

The result variable is set to the button that was clicked: `OK`, `Cancel`, `Abort`, `Retry`, `Ignore`, `Yes`, `No`, `TryAgain`, or `Continue`. If the timeout expires first, it is set to `Timeout`.

For example, to run a group only when the technician answers **Yes**, add this condition to the group:

```powershell
$tsenv:MessageBoxResult -eq "Yes"
```

### From PowerShell

The step uses the `Show-DeployRMessageBox` cmdlet from the `DeployR.Utility` module, which you can call from your own **Run PowerShell script** steps:

```powershell
Import-Module DeployR.Utility
$answer = Show-DeployRMessageBox -Message "Continue with the deployment?" -Title "DeployR" -Buttons YesNo -Icon Question -TimeoutSeconds 300
```

The cmdlet returns the result and also saves it in the variable named by `-VariableName` (default `MessageBoxResult`). It only works inside a running task sequence.

{% hint style="info" %}
If a step needs to show its own window, the related `Set-DeployRProgressWindow -State Minimized` cmdlet minimizes the progress UI, and `Set-DeployRProgressWindow -State Restored` brings it back. Message boxes are still displayed while the progress UI is minimized.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.2pintsoftware.com/deployr/reference/step-definitions/show-message-box.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
