> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/de/apps/components/feedback/modal.md). Agents can also search and read this documentation through its [MCP server](https://docs.devolutions.net/~gitbook/mcp).

# Modal

Fügen Sie modale Dialoge in PowerShell Universal-Apps hinzu, um kritische Informationen anzuzeigen, Entscheidungen anzufordern und Vollbild, Breite und Persistenz zu steuern.

Modale Dialoge informieren Benutzer über eine Aufgabe und können kritische Informationen enthalten, Entscheidungen erfordern oder mehrere Aufgaben umfassen.

## Einfach

```powershell
New-UDButton -Text 'Basic' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    }
}
```

## Vollbild

```powershell
New-UDButton -Text 'Full Screen' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    } -Footer {
        New-UDButton -Text "Close" -OnClick { Hide-UDModal }
    }  -FullScreen
}
```

## Volle Breite

Modale Dialoge mit voller Breite nehmen die gesamte Breite ein, die durch den Parameter `-MaxWidth` definiert ist.

```powershell
New-UDButton -Text 'Full Width' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    } -FullWidth -MaxWidth 'md'
}
```

## Persistent

Persistente modale Dialoge werden nicht geschlossen, wenn Sie außerhalb davon klicken. Sie müssen sie mit `Hide-UDModal` schließen.

```powershell
New-UDButton -Text 'Persistent' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    } -Footer {
        New-UDButton -Text "Close" -OnClick { Hide-UDModal }
    } -Persistent
}
```

## Einen modalen Dialog ausblenden

Sie können die `Hide-UDModal`-Schaltfläche verwenden, um einen modalen Dialog auszublenden, der derzeit angezeigt wird.

```powershell
New-UDButton -Text 'Basic' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    }
    Start-Sleep 5
    Hide-UDModal
}
```

Wenn Sie mehrere modale Dialoge öffnen, können Sie auch den Parameter `-All` von `Hide-UDModal` verwenden, um alle auf einmal auszublenden, anstatt einen nach dem anderen.

```powershell
New-UDButton -Text 'Parent' -OnClick {
    Show-UDModal -Content {
       New-UDButton -Text 'Child' -OnClick {
          Show-UDModal -Content {
              New-UDButton -Text 'hide current' -OnClick {
                  Hide-UDModal
              }
              New-UDButton -Text 'hide all' -OnClick {
                  Hide-UDModal -All
              }
          } 
       }
    }
}
```

## Styling

Sie können Module mit den Parametern `-Style`, `-HeaderStyle`, `-ContentStyle` und `-FooterStyle` stylen. Style wird auf den gesamten modalen Dialog selbst angewendet, und die einzelnen Abschnitts-Styles werden nur auf diese Abschnitte angewendet. Die Werte für diese Parameter sind Hashtables mit CSS-Werten.

```powershell
New-UDButton -Text 'Styling' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    } -Style @{
        backgroundColor = "red"
    }
}
```

## API

* [Show-UDModal](https://docs.devolutions.net/powershell-universal/de/powershell-befehle/show-udmodal.md)
* [Hide-UDModal](https://docs.devolutions.net/powershell-universal/de/powershell-befehle/hide-udmodal.md)

### Siehe auch

* [Devolutions Academy – Hinzufügen des Zurücksetzens von Benutzerpasswörtern](https://academy.devolutions.net/student/activity/3546111-part-6-adding-reset-user-password)
* [Devolutions Academy – Hinzufügen der Benutzersuchfunktion](https://academy.devolutions.net/student/activity/3542903-part-2-adding-the-search-users-function)


---

# 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://docs.devolutions.net/powershell-universal/de/apps/components/feedback/modal.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.
