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

# New-UDAvatar

New-UDAvatar crée un composant d'avatar dans PowerShell Universal qui affiche une image ou une icône d'utilisateur dans un tableau de bord.

### Résumé

Crée un nouvel avatar.

### Syntaxe

```powershell
New-UDAvatar [[-Id] <String>] [[-Image] <String>] [[-Alt] <String>] [[-ClassName] <String>] [[-Variant] <String>] [[-Sx] <Object>] [[-Children] <ScriptBlock>] [<CommonParameters>]
```

### Description

Crée un nouvel avatar. Un avatar est habituellement une image d'un utilisateur.

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

#### -Image

L'URL d'une image à afficher dans l'avatar.

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

#### -Alt

Le texte alt à attribuer à l'avatar.

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

#### -ClassName

Classes à attribuer au composant d'avatar.

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

#### -Variant

Le type de variante de l'avatar. Les valeurs valides sont : "square", "rounded"

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

#### -Sx

La propriété sx vous permet de définir des styles CSS personnalisés qui seront appliqués au composant.

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

#### -Children

Le contenu à afficher dans l'avatar.

```
Required?                    false
Position?                    7
Default value                { "A" }
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, consultez [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Sorties

### Exemples

#### Exemple 1 : Avatar de base

```powershell
New-UDAvatar -Alt "Remy Sharp" -Image "/assets/logo.png"
```

Affiche un avatar de base avec une image.

#### Exemple 2 : Avatar carré

```powershell
New-UDAvatar -Alt "Remy Sharp" -Content { "B" } -Variant square
```

Affiche un avatar carré avec une image.

#### Exemple 3 : Avatar avec texte

```powershell
New-UDAvatar -Alt "Remy Sharp" -Content {
  "A"
} -Sx @{
  borderRadius = '50%'
}
```

Affiche un avatar avec du texte et des styles CSS personnalisés.

#### Exemple 4 : Groupe d'avatars

```powershell
New-UDAvatarGroup -Content {
  1..10 | ForEach-Object {
    New-UDAvatar -Alt "Remy Sharp" -Content {
        "A"
    } -Sx @{
        borderRadius    = '50%'
        backgroundColor = 'error.dark'
    }
  }
} -Sx @{
   width = "20%"
}
```

Affiche un groupe d'avatars.

#### Exemple 5 : Tailles

```powershell
New-UDAvatar -Alt "Remy Sharp" -Content {
  "A"
} -Sx @{
  width = 24
  height = 24
}
New-UDAvatar -Alt "Remy Sharp" -Content {
  "A"
}
New-UDAvatar -Alt "Remy Sharp" -Content {
  "A"
} -Sx @{
  width = 56
  height = 56
}
```

Affiche un groupe d'avatars de différentes tailles.

#### Exemple 6 : Icônes

```powershell
New-UDAvatar -Alt "Remy Sharp" -Content {
  New-UDIcon -Icon "User"
}
```

Affiche un avatar avec une icône.

#### Exemple 7 : Solution de repli

```powershell
New-UDAvatar -Alt "Remy Sharp" -Image "/broken.png" -Content { "A" }
```

Affiche un avatar avec une solution de repli vers une image brisée.

#### Exemple 8 : Badge

```powershell
New-UDBadge -BadgeContent {
    10
} -Children {
    New-UDAvatar
}
```

Affiche un avatar avec un badge.


---

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