> 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/da/powershell-kommandoer/new-udbadge.md).

# New-UDBadge

New-UDBadge opretter en lille badgekomponent i PowerShell Universal, der viser et antal eller en statusindikator i hjørnet af sit underordnede element.

### Synopsis

Badge genererer en lille badge øverst til højre for sine underordnede element(er).

### Syntaks

```powershell
New-UDBadge [[-Id] <String>] [[-Color] <String>] [[-Children] <ScriptBlock>] [[-BadgeContent] <ScriptBlock>] [-Invisible] [[-Max] <Int32>] [[-Overlap] <String>] [-ShowZero] [[-Variant] <String>] [[-Location] <String>] [[-Sx] <Hashtable>] [<CommonParameters>]
```

### Beskrivelse

Badge genererer en lille badge øverst til højre for sine underordnede element(er).

### Parametre

#### -Id

Id for komponenten. Standardværdien er et tilfældigt GUID.

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

#### -Color

Badgens farve. Gyldige værdier er: "default", "primary", "secondary", "error", "info", "success", "warning"

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

#### -Children

Det indhold, som badget er knyttet til.

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

#### -BadgeContent

Indholdet, der skal vises i badget.

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

#### -Invisible

Om badget er usynligt.

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

#### -Max

Det maksimale tal, der skal vises. Hvis tallet er større end dette, vises det som "99+". Standard er 99.

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

#### -Overlap

Overlappet for badget. Gyldige værdier er: "circular", "rectangular"

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

#### -ShowZero

Om badget skal vises, når badgeContent er 0.

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

#### -Variant

Varianten af badgen. Gyldige værdier er: "standard", "dot"

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

#### -Location

Placeringen af badgen. Gyldige værdier er: "topright", "topleft", "bottomright", "bottomleft"

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

#### -Sx

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

#### Fælles parametre

Denne cmdlet understøtter de fælles parametre: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable og OutVariable. Se [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216) for at få flere oplysninger.

### Noter

Generelle noter

\[Component("Badge", "Badge", "Opretter et nyt badge.")]

### Eksempler

#### Eksempel 1: primært badge

```powershell
New-UDBadge -Color primary -BadgeContent { 4 } -Children {
  New-UDButton -Text "Primary"
} -Id 'badge1'
```

Viser et badge med teksten "4" på en primær knap.

#### Eksempel 2: farve

```powershell
New-UDBadge -Color secondary -BadgeContent { 4 } -Children {
  New-UDIcon -Icon Envelope -Size 2x
} -Id 'badge2'
New-UDBadge -Color error -BadgeContent { 4 } -Children {
  New-UDIcon -Icon Envelope -Size 2x
} -Id 'badge3'
```

Ændrer farven på badget.

#### Eksempel 3: ShowZero

```powershell
New-UDBadge -ShowZero -BadgeContent { 0 } -Children {
  New-UDIcon -Icon Envelope -Size 2x
} -Id 'badge4'
```

Viser badget, når badgeContent er 0.

#### Eksempel 4: Max

```powershell
New-UDBadge -Max 10 -BadgeContent { 11 } -Children {
  New-UDIcon -Icon Envelope -Size 2x
} -Id 'badge5'
```

Det maksimale tal, der skal vises. Hvis tallet er større end dette, vises det som "99+". Standard er 99.

#### Eksempel 5: overlap

```powershell
New-UDBadge -Overlap circular -BadgeContent { 4 } -Children {
  New-UDIcon -Icon Envelope -Size 2x
} -Id 'badge6'
```

Overlappet for badget.

#### Eksempel 6: Dot

```powershell
New-UDBadge -Variant dot -BadgeContent { 4 } -Children {
  New-UDIcon -Icon Envelope -Size 2x
} -Id 'badge7'
```

Vis et prikbadge.


---

# 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/da/powershell-kommandoer/new-udbadge.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.
