> 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/powershell-befehle/new-udbutton.md).

# New-UDButton

New-UDButton erstellt eine anklickbare Schaltflächenkomponente in PowerShell Universal, die eine Aktion, ein Skript oder eine Linknavigation auslöst.

### Übersicht

Schaltflächen ermöglichen es Benutzern, mit einem einzigen Tippen Aktionen auszuführen und Auswahlen zu treffen..

### Syntax

```powershell
New-UDButton [[-Text] <String>] [[-Icon] <Object>] [[-Variant] <String>] [[-IconAlignment] <String>] [[-FullWidth]] [[-OnClick] <Endpoint>] [[-Size] <String>] [[-Style] <Hashtable>] [[-Href] <String>] [-Target <String>] [-Id <String>] [-Color <String>] [-Disabled] [-ClassName <String>] [-ShowLoading] [-LoadingIndicator <Object>] [-LoadingPosition <String>] [-Aria <ScriptBlock>] [<CommonParameters>]
```

### Beschreibung

Erstellt eine neue Schaltfläche. Schaltflächen ermöglichen es Benutzern, mit einem einzigen Tippen Aktionen auszuführen und Auswahlen zu treffen.

### Parameter

#### -Text

Der Text, der innerhalb der Schaltfläche angezeigt werden soll.

```
Required?                    false
Position?                    1
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Icon

Ein Symbol, das innerhalb der Schaltfläche angezeigt werden soll. Verwenden Sie New-UDIcon, um ein Symbol für diesen Parameter zu erstellen.

```
Required?                    false
Position?                    2
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Variant

Der Variantentyp für diese Schaltfläche. Gültige Werte sind: "text", "outlined", "contained"

```
Required?                    false
Position?                    3
Default value                contained
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -IconAlignment

Wie das Symbol innerhalb der Schaltfläche ausgerichtet wird. Gültige Werte sind: "left", "right"

```
Required?                    false
Position?                    4
Default value                left
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -FullWidth

Ob die Schaltfläche die gesamte Breite ihres Containers einnimmt.

```
Required?                    false
Position?                    7
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -OnClick

Die Aktion, die beim Klicken auf die Schaltfläche ausgeführt wird.

```
Required?                    false
Position?                    8
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Size

Die Größe der Schaltfläche. Gültige Werte sind: "small", "medium", "large"

```
Required?                    false
Position?                    9
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Style

Stile, die auf die Schaltfläche angewendet werden.

```
Required?                    false
Position?                    10
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Href

Eine URL, zu der der Benutzer beim Klicken auf die Schaltfläche weitergeleitet werden soll.

```
Required?                    false
Position?                    11
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Target

```
Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Id

Die ID der Komponente. Standardmäßig ist dies eine zufällige GUID.

```
Required?                    false
Position?                    named
Default value                ([Guid]::NewGuid()).ToString()
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Color

Die Farbe der Komponente. Gültige Werte sind: 'default', 'inherit', 'primary', 'secondary', 'info', 'warning', 'error', 'success'

```
Required?                    false
Position?                    named
Default value                primary
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Disabled

Ob die Schaltfläche deaktiviert ist.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ClassName

Die CSS-Klasse, die auf die Schaltfläche angewendet wird.

```
Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ShowLoading

Zeigt einen Lade-Spinner an, während der OnClick-Ereignishandler ausgeführt wird.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -LoadingIndicator

Ein benutzerdefiniertes Element, das anstelle des integrierten Spinners für -ShowLoading angezeigt wird

```
Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -LoadingPosition

Die Position des Ladeindikators. Gültige Werte sind: 'start', 'end', 'center'

```
Required?                    false
Position?                    named
Default value                center
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Aria

Ein Skriptblock mit `New-UDAriaAttribute`-Aufrufen. Die resultierenden ARIA- oder Rollenattribute werden auf die Schaltfläche angewendet. Beispiel: `-Aria { New-UDAriaAttribute -Label -Value 'Save changes' }` gibt der Schaltfläche eine barrierefreie Bezeichnung.

```
Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### Allgemeine Parameter

Dieses Cmdlet unterstützt die allgemeinen Parameter: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable und OutVariable. Weitere Informationen finden Sie unter [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Ausgaben

### Beispiele

#### Beispiel 1: Einfache Schaltflächen

```powershell
New-UDButton -Variant 'text' -Text 'Text' -Id 'button1'
New-UDButton -Variant 'contained' -Text 'Contained'  -Id 'button2'
New-UDButton -Variant 'outlined' -Text 'Outlined' -Id 'button3'
```

UDButton bietet drei Varianten: text, contained und outlined.

#### Beispiel 2: Klicks verarbeiten

```powershell
New-UDButton -Text 'Click me' -OnClick {
  Show-UDToast -Message 'Hello, world!'
} -Id 'button4'
```

PowerShell, das beim Klicken auf die Schaltfläche ausgeführt wird.

#### Beispiel 3: Farbe

```powershell
New-UDButton -Text 'Secondary' -Color secondary -Id 'button5'
New-UDButton -Text 'Success' -Color success -Id 'button6'
New-UDButton -Text 'Error' -Color error -Id 'button7'
```

Passen Sie die Schaltflächenfarbe mit -Color an

#### Beispiel 4: Größen

```powershell
New-UDButton -Variant 'text' -Text 'small' -Id 'button8' -Size small
New-UDButton -Variant 'text' -Text 'medium'  -Id 'button9' -Size medium
New-UDButton -Variant 'text' -Text 'large' -Id 'button10' -Size large
New-UDButton -Variant 'contained' -Text 'small' -Id 'button11'  -Size small
New-UDButton -Variant 'contained' -Text 'medium'  -Id 'button12'  -Size medium
New-UDButton -Variant 'contained' -Text 'large' -Id 'button13'  -Size large
New-UDButton -Variant 'outlined' -Text 'small' -Id 'button14'  -Size small
New-UDButton -Variant 'outlined' -Text 'medium'  -Id 'button15'  -Size medium
New-UDButton -Variant 'outlined' -Text 'large' -Id 'button16'  -Size large
```

Für größere oder kleinere Schaltflächen verwenden Sie den Parameter -Size.

#### Beispiel 5: Symbol

```powershell
New-UDButton -Icon (New-UDIcon -Icon 'User') -Text 'View User' -Id 'button17'
```

Ein Symbol innerhalb der Schaltfläche anzeigen

#### Beispiel 6: Laden

```powershell
New-UDButton -OnClick { Start-Sleep 3 } -ShowLoading -Text 'Load Data' -Id 'button18'
```

Zeigt eine Ladeanzeige an, während der OnClick-Ereignishandler ausgeführt wird.


---

# 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/powershell-befehle/new-udbutton.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.
