> 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/fr/commandes-powershell/new-udbadge.md).

# New-UDBadge

New-UDBadge crée un petit composant de badge dans PowerShell Universal qui affiche un compteur ou un indicateur d'état dans le coin de son élément enfant.

### Synopsis

Badge génère un petit badge en haut à droite de son ou ses enfants.

### Syntaxe

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

### Description

Badge génère un petit badge en haut à droite de son ou ses enfants.

### Paramètres

#### -Id

L'ID du composant. Il s'agit par défaut d'un GUID aléatoire.

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

#### -Color

La couleur du badge. Les valeurs valides sont : "default", "primary", "secondary", "error", "info", "success", "warning"

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

#### -Children

Le contenu auquel le badge est rattaché.

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

#### -BadgeContent

Le contenu à afficher dans le badge.

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

#### -Invisible

Indique si le badge est invisible.

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

#### -Max

Le nombre maximal à afficher. Si le nombre est supérieur à celui-ci, il s'affichera comme "99+". La valeur par défaut est 99.

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

#### -Overlap

Le chevauchement du badge. Les valeurs valides sont : "circular", "rectangular"

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

#### -ShowZero

Indique s'il faut afficher le badge lorsque badgeContent est 0.

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

#### -Variant

La variante du badge. Les valeurs valides sont : "standard", "dot"

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

#### -Location

L'emplacement du badge. Les valeurs valides sont : "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
```

#### Paramètres communs

Cette applet de commande prend en charge les paramètres communs : Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable et OutVariable. Pour plus d'information, voir [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Notes

Notes générales

\[Component("Badge", "Badge", "Creates a new badge.")]

### Exemples

#### Exemple 1 : Badge principal

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

Affiche un badge avec le texte "4" sur un bouton principal.

#### Exemple 2 : Couleur

```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'
```

Change la couleur du badge.

#### Exemple 3 : ShowZero

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

Affiche le badge lorsque badgeContent est 0.

#### Exemple 4 : Max

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

Le nombre maximal à afficher. Si le nombre est supérieur à celui-ci, il s'affichera comme "99+". La valeur par défaut est 99.

#### Exemple 5 : Overlap

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

Le chevauchement du badge.

#### Exemple 6 : Dot

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

Affiche un badge en forme de point.


---

# 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/fr/commandes-powershell/new-udbadge.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.
