> 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-udupload.md).

# New-UDUpload

New-UDUpload fügt PowerShell Universal ein Datei-Upload-Steuerelement hinzu, das zusammen mit den Komponenten New-UDForm und New-UDStepper funktioniert.

### Übersicht

Dateien hochladen

### Syntax

```powershell
New-UDUpload [[-Id] <String>] [[-Accept] <String>] [[-OnUpload] <Endpoint>] [[-OnUploadProgress] <Endpoint>] [[-Text] <String>] [[-Variant] <String>] [[-Color] <String>] [[-ClassName] <String>] [-HideUploadedFileName] [-Multiple] [-ShowLoading] [[-LoadingIndicator] <Object>] [[-LoadingPosition] <String>] [[-Icon] <Object>] [[-IconAlignment] <String>] [[-Style] <Hashtable>] [[-Aria] <ScriptBlock>] [<CommonParameters>]
```

### Beschreibung

Dateien hochladen. Diese Komponente funktioniert mit UDForm und UDStepper.

### Parameter

#### -Id

Die ID des Uploaders.

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

#### -Accept

Der Typ der zu akzeptierenden Dateien. Standardmäßig akzeptiert diese Komponente alle Dateien.

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

#### -OnUpload

Ein Skriptblock, der beim Hochladen einer Datei ausgeführt wird. Dieser $body-Parameter enthält JSON im folgenden Format:

{ data: 'base64 encoded string of file data', name: 'filename', type: 'type of file, if known' }

$EventData enthält eine Klasse mit den folgenden Eigenschaften:

public string Name { get; set; } public string FileName { get; set; } public DateTime TimeStamp { get; set; } public string ContentType { get; set; } public string Type => ContentType;

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

#### -OnUploadProgress

Ein Endpunkt, der aufgerufen wird, wenn sich der Uploadfortschritt ändert. `$EventData` enthält `fileName`, `fileIndex`, `fileCount`, `fileProgress`, `totalProgress`, `bytesUploaded`, `totalBytes`, `fileSize` und `uploadedFileSize`.

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

#### -Text

Der Text, der auf der Upload-Schaltfläche angezeigt wird.

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

#### -Variant

Die Variante der Schaltfläche. Standardwert ist contained. Gültige Werte: "text", "outlined", "contained"

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

#### -Color

Die Farbe der Schaltfläche. Standardwert ist 'default'. Gültige Werte: "default", "primary", "secondary", "inherit"

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

#### -ClassName

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

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

#### -HideUploadedFileName

Blendet den Dateinamen-Text aus, der nach dem Hochladen angezeigt wird

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

#### -Multiple

Erlaubt die Auswahl und das Hochladen mehrerer Dateien. Mit diesem Schalter empfängt der Handler `-OnUpload` ein Array von Uploadobjekten in `$EventData`.

```
Required?                    false
Position?                    named
Default value                False
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?                    8
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?                    9
Default value                center
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Icon

Das Symbol, das anstelle des Standardsymbols angezeigt wird. Verwenden Sie New-UDIcon, um ein Symbol zu erstellen.

```
Required?                    false
Position?                    10
Default value
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?                    11
Default value                left
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Style

Eine Hashtable von CSS-Formatvorlagen, die auf die Uploadkomponente angewendet werden.

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

#### -Aria

Ein Skriptblock mit `New-UDAriaAttribute`-Aufrufen, der ARIA- oder Rollenattribute für das Uploadsteuerelement bereitstellt.

```
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: Einfacher Upload

```powershell
New-UDUpload -Text "Upload" -OnUpload {
    Show-UDToast $Body
} -Id 'upload1'
```

Eine einfache Upload-Komponente, die beim Hochladen einer Datei einen Toast anzeigt.

#### Beispiel 2: Dateiname ausblenden

```powershell
New-UDUpload -Text "Upload" -OnUpload {
    Show-UDToast $Body
} -Id 'upload2' -HideUploadedFileName
```

Blendet den Dateinamen-Text aus, der nach dem Hochladen angezeigt wird.

#### Beispiel 3: Symbol

```powershell
New-UDUpload -Text "Upload" -OnUpload {
    Show-UDToast $Body
} -Id 'upload3' -Icon (New-UDIcon -Icon 'Upload')
```

Upload-Komponente mit einem Symbol anstelle des Standardsymbols.

#### Beispiel 4: Symbolausrichtung

```powershell
New-UDUpload -Text "Upload" -OnUpload {
    Show-UDToast $Body
} -Id 'upload4' -IconAlignment 'right' -Icon (New-UDIcon -Icon 'Upload')
```

Upload-Komponente mit einem Symbol auf der rechten Seite der Schaltfläche.

#### Beispiel 5: Variante

```powershell
New-UDUpload -Text "Upload" -OnUpload {
    Show-UDToast $Body
} -Id 'upload5' -Variant 'text'
```

Upload-Komponente mit einer Textvariante.

#### Beispiel 6: Accept

```powershell
New-UDUpload -Text "Upload" -OnUpload {
    Show-UDToast $Body
} -Id 'upload6' -Accept ".jpg"
```

Upload-Komponente, die nur .jpg-Dateien akzeptiert.


---

# 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-udupload.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.
