> 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/it/comandi-powershell/new-udavatar.md).

# New-UDAvatar

New-UDAvatar crea un componente avatar in PowerShell Universal che mostra un'immagine utente o un'icona all'interno di una dashboard.

### Sinossi

Crea un nuovo Avatar.

### Sintassi

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

### Descrizione

Crea un nuovo Avatar. Un avatar è tipicamente un'immagine di un utente.

### Parametri

#### -Id

L'ID del componente. Per impostazione predefinita è un GUID casuale.

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

#### -Image

L'URL di un'immagine da mostrare nell'avatar.

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

#### -Alt

Il testo alternativo da assegnare all'avatar.

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

#### -ClassName

Classi da assegnare al componente avatar.

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

#### -Variant

Il tipo di variante dell'avatar. I valori validi sono: "square", "rounded"

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

#### -Sx

La proprietà sx consente di definire stili CSS personalizzati che verranno applicati al componente.

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

#### -Children

Il contenuto da visualizzare all'interno dell'avatar.

```
Required?                    false
Position?                    7
Default value                { "A" }
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### Parametri comuni

Questo cmdlet supporta i parametri comuni: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable e OutVariable. Per maggiori informazioni, veda [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Output

### Esempi

#### Esempio 1: Avatar di base

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

Mostra un avatar di base con un'immagine.

#### Esempio 2: Avatar quadrato

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

Mostra un avatar quadrato con un'immagine.

#### Esempio 3: Avatar con testo

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

Mostra un avatar con testo e stili CSS personalizzati.

#### Esempio 4: Gruppo di avatar

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

Mostra un gruppo di avatar.

#### Esempio 5: Dimensioni

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

Mostra un gruppo di avatar con dimensioni diverse.

#### Esempio 6: Icone

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

Mostra un avatar con un'icona.

#### Esempio 7: Fallback

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

Mostra un avatar con un fallback a un'immagine non valida.

#### Esempio 8: Badge

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

Mostra un avatar con 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/it/comandi-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.
