> 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

### Übersicht

Schaltflächen ermöglichen 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>] [<CommonParameters>]
```

### Beschreibung

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

### Parameter

#### -Text

Der innerhalb der Schaltfläche anzuzeigende Text.

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

#### -Icon Ein innerhalb der Schaltfläche anzuzeigendes Symbol. Verwenden Sie New-UDIcon, um ein Symbol für diesen Parameter zu erstellen.Required?                    falsePosition?                    2Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-VariantDer Variantentyp für diese Schaltfläche. Gültige Werte sind: "text", "outlined", "contained"Required?                    falsePosition?                    3Default value                containedAccept pipeline input?       falseAliasesAccept wildcard characters?  false-IconAlignmentWie das Symbol innerhalb der Schaltfläche ausgerichtet wird. Gültige Werte sind: "left", "right"Required?                    falsePosition?                    4Default value                leftAccept pipeline input?       falseAliasesAccept wildcard characters?  false    -FullWidth \[\<SwitchParameter>]        Whether the button takes the full width of the it's container.Required?                    falsePosition?                    7Default value                FalseAccept pipeline input?       falseAliasesAccept wildcard characters?  false-OnClickDie Aktion, die beim Klicken auf die Schaltfläche ausgeführt wird.Required?                    falsePosition?                    8Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-SizeDie Größe der Schaltfläche. Gültige Werte sind: "small", "medium", "large"Required?                    falsePosition?                    9Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-StyleStile, die auf die Schaltfläche angewendet werden.Required?                    falsePosition?                    10Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-HrefEine URL, zu der der Benutzer beim Klicken auf die Schaltfläche weitergeleitet werden soll.Required?                    falsePosition?                    11Default valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-TargetRequired?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-IdDie ID der Komponente. Standardmäßig ist dies eine zufällige GUID.Required?                    falsePosition?                    namedDefault value                (\[Guid]::NewGuid()).ToString()Accept pipeline input?       falseAliasesAccept wildcard characters?  false-ColorDie Farbe der Komponente. Gültige Werte sind: 'default', 'inherit', 'primary', 'secondary', 'info', 'warning', 'error', 'success'Required?                    falsePosition?                    namedDefault value                primaryAccept pipeline input?       falseAliasesAccept wildcard characters?  false    -Disabled \[\<SwitchParameter>]        Whether the button is disabled.Required?                    falsePosition?                    namedDefault value                FalseAccept pipeline input?       falseAliasesAccept wildcard characters?  false-ClassNameDie CSS-Klasse, die auf die Schaltfläche angewendet wird.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false    -ShowLoading \[\<SwitchParameter>]        Displays a loading spinner while the OnClick event handler is running.Required?                    falsePosition?                    namedDefault value                FalseAccept pipeline input?       falseAliasesAccept wildcard characters?  false-LoadingIndicator Ein benutzerdefiniertes Element, das anstelle des integrierten Spinners für -ShowLoading angezeigt wirdRequired?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-LoadingPositionDie Position der Ladeanzeige. Gültige Werte sind: 'start', 'end', 'center'Required?                    falsePosition?                    namedDefault value                centerAccept pipeline input?       falseAliasesAccept wildcard characters?  false    \<CommonParameters>        This cmdlet supports the common parameters: Verbose, Debug,        ErrorAction, ErrorVariable, WarningAction, WarningVariable,        OutBuffer, PipelineVariable, and OutVariable. For more information, see        about\_CommonParameters (<https://go.microsoft.com/fwlink/?LinkID=113216).Ausgaben--------------------------> BEISPIEL 1 --------------------------PS >New-UDButton -Variant 'text' -Text 'Text' -Id 'button1'PS > New-UDButton -Variant 'contained' -Text 'Contained'  -Id 'button2'PS > New-UDButton -Variant 'outlined' -Text 'Outlined' -Id 'button3'Basic buttons|UDButton comes with three variants: text, contained, and outlined.-------------------------- EXAMPLE 2 --------------------------PS >New-UDButton -Text 'Click me' -OnClick {PS >   Show-UDToast -Message 'Hello, world!'PS > } -Id 'button4'Handling clicks|PowerShell that is executed when the button is clicked.-------------------------- EXAMPLE 3 --------------------------PS >New-UDButton -Text 'Secondary' -Color secondary -Id 'button5'PS > New-UDButton -Text 'Success' -Color success -Id 'button6'PS > New-UDButton -Text 'Error' -Color error -Id 'button7'Color|Adjust the button color with -Color-------------------------- EXAMPLE 4 --------------------------PS >New-UDButton -Variant 'text' -Text 'small' -Id 'button8' -Size smallPS > New-UDButton -Variant 'text' -Text 'medium'  -Id 'button9' -Size mediumPS > New-UDButton -Variant 'text' -Text 'large' -Id 'button10' -Size largePS > New-UDButton -Variant 'contained' -Text 'small' -Id 'button11'  -Size smallPS > New-UDButton -Variant 'contained' -Text 'medium'  -Id 'button12'  -Size mediumPS > New-UDButton -Variant 'contained' -Text 'large' -Id 'button13'  -Size largePS > New-UDButton -Variant 'outlined' -Text 'small' -Id 'button14'  -Size smallPS > New-UDButton -Variant 'outlined' -Text 'medium'  -Id 'button15'  -Size mediumPS > New-UDButton -Variant 'outlined' -Text 'large' -Id 'button16'  -Size largeSizes|For larger or smaller buttons, use the -Size parameter.-------------------------- EXAMPLE 5 --------------------------PS >New-UDButton -Icon (New-UDIcon -Icon 'User') -Text 'View User' -Id 'button17'Icon|Display an icon within the button-------------------------- EXAMPLE 6 --------------------------PS >New-UDButton -OnClick { Start-Sleep 3 } -ShowLoading -Text 'Load Data' -Id 'button18'Loading|Show a loading indicator while the OnClick event handler is running.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/de/powershell-befehle/new-udbutton.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
