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

# New-UDList

New-UDList crea un contenitore elenco verticale in PowerShell Universal per voci di testo o immagini aggiunte con New-UDListItem, ideale per la navigazione nei drawer.

### Sinossi

Gli elenchi sono indici verticali continui di testo o immagini.

### Sintassi

```powershell
New-UDList [[-Id] <String>] [[-Children] <ScriptBlock>] [[-SubHeader] <String>] [[-ClassName] <String>] [-Dense] [[-Sx] <Hashtable>] [[-AlignItems] <String>] [<CommonParameters>]
```

### Descrizione

Crea un elenco. Utilizzi New-UDListItem per aggiungere nuovi elementi all'elenco. Gli elenchi sono utili per i collegamenti nei UDDrawers.

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

#### -Children

Gli elementi dell'elenco.

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

#### -SubHeader

Testo da mostrare all'interno del sotto-intestazione.

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

#### -ClassName

Una classe CSS da applicare all'elenco.

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

#### -Dense

Indica se l'elenco è denso.

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

#### -Sx

Una hashtable di stili da applicare a questo componente.

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

#### -AlignItems

```
Required?                    false
Position?                    6
Default value
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: elenco di base

```powershell
New-UDList -Content {
   New-UDListItem -Label 'Inbox' -Icon (New-UDIcon -Icon envelope -Size 3x) -SubTitle 'New Stuff'
   New-UDListItem -Label 'Drafts' -Icon (New-UDIcon -Icon edit -Size 3x) -SubTitle "Stuff I'm working on "
   New-UDListItem -Label 'Trash' -Icon (New-UDIcon -Icon trash -Size 3x) -SubTitle 'Stuff I deleted'
   New-UDListItem -Label 'Spam' -Icon (New-UDIcon -Icon bug -Size 3x) -SubTitle "Stuff I didn't want"
} -Id 'list1'
```

Un elenco di base di elementi con icone e un sottotitolo.

#### Esempio 2: elenco denso

```powershell
New-UDList -Content {
   New-UDListItem -Label 'Inbox'
   New-UDListItem -Label 'Drafts'
   New-UDListItem -Label 'Trash'
   New-UDListItem -Label 'Spam'
} -Id 'list2' -Dense
```

Un elenco denso.

#### Esempio 3: OnClick

```powershell
New-UDList -Content {
   New-UDListItem -Label 'Inbox' -Icon (New-UDIcon -Icon envelope -Size 3x) -SubTitle 'New Stuff' -OnClick {
       Show-UDToast -Message 'Inbox Clicked'
   }
   New-UDListItem -Label 'Drafts' -Icon (New-UDIcon -Icon edit -Size 3x) -SubTitle "Stuff I'm working on " -OnClick {
       Show-UDToast -Message 'Drafts Clicked'
   }
} -Id 'list3'
```

Rispondere ai clic sugli elementi dell'elenco.

#### Esempio 4: azione secondaria

```powershell
New-UDList -Content {
   New-UDListItem -Label 'Inbox' -Icon (New-UDIcon -Icon envelope -Size 3x) -SubTitle 'New Stuff' -SecondaryAction {
       New-UDButton -Text 'Secondary Action'
   }
   New-UDListItem -Label 'Drafts' -Icon (New-UDIcon -Icon edit -Size 3x) -SubTitle "Stuff I'm working on " -SecondaryAction {
       New-UDButton -Text 'Secondary Action'
   }
} -Id 'list4'
```

Rispondere alle azioni secondarie sugli elementi dell'elenco.

#### Esempio 5: elementi di elenco annidati

```powershell
New-UDList -Content {
   New-UDListItem -Label 'Inbox' -Icon (New-UDIcon -Icon envelope -Size 3x) -SubTitle 'New Stuff' -Children {
       New-UDListItem -Label 'Inbox Item 1' -Nested
       New-UDListItem -Label 'Inbox Item 2' -Nested
       New-UDListItem -Label 'Inbox Item 3' -Nested
   }
   New-UDListItem -Label 'Drafts' -Icon (New-UDIcon -Icon edit -Size 3x) -SubTitle "Stuff I'm working on " -Children {
       New-UDListItem -Label 'Drafts Item 1' -Nested
       New-UDListItem -Label 'Drafts Item 2' -Nested
       New-UDListItem -Label 'Drafts Item 3' -Nested
   }
} -Id 'list5'
```

Creare elementi di elenco annidati.

#### Esempio 6: switch

```powershell
New-UDList -Content {
   New-UDListItem -Label 'Inbox' -Icon (New-UDIcon -Icon envelope -Size 3x) -SubTitle 'New Stuff' -Switch (New-UDSwitch) -SwitchAlignment 'right'
   New-UDListItem -Label 'Drafts' -Icon (New-UDIcon -Icon edit -Size 3x) -SubTitle "Stuff I'm working on " -Switch (New-UDSwitch) -SwitchAlignment 'right'
   New-UDListItem -Label 'Trash' -Icon (New-UDIcon -Icon trash -Size 3x) -SubTitle 'Stuff I deleted' -Switch (New-UDSwitch) -SwitchAlignment 'right'
   New-UDListItem -Label 'Spam' -Icon (New-UDIcon -Icon bug -Size 3x) -SubTitle "Stuff I didn't want" -Switch (New-UDSwitch) -SwitchAlignment 'right'
} -Id 'list6'
```

Creare un elemento di elenco con uno switch.

#### Esempio 7: CheckBox

```powershell
New-UDList -Content {
   New-UDListItem -Label 'Inbox' -SubTitle 'New Stuff' -CheckBox (New-UDCheckbox) -CheckBoxAlignment 'left'
   New-UDListItem -Label 'Drafts' -SubTitle "Stuff I'm working on " -CheckBox (New-UDCheckbox) -CheckBoxAlignment 'left'
   New-UDListItem -Label 'Trash' -SubTitle 'Stuff I deleted' -CheckBox (New-UDCheckbox) -CheckBoxAlignment 'left'
   New-UDListItem -Label 'Spam' -SubTitle "Stuff I didn't want" -CheckBox (New-UDCheckbox) -CheckBoxAlignment 'left'
} -Id 'list7'
```

Creare un elemento di elenco con una casella di controllo.

#### Esempio 8: collegamenti

```powershell
New-UDList -Content {
   New-UDListItem -Label 'Inbox' -SubTitle 'New Stuff' -Href 'https://devolutions.net/powershell-universal/' -OpenInNewWindow
   New-UDListItem -Label 'Drafts' -SubTitle "Stuff I'm working on " -Href 'https://powershellgallery.com' -OpenInNewWindow
   New-UDListItem -Label 'Trash' -SubTitle 'Stuff I deleted' -Href 'https://github.com/powershell/powershell' -OpenInNewWindow
   New-UDListItem -Label 'Spam' -SubTitle "Stuff I didn't want"
} -Id 'list7'
```

Creare un elemento di elenco con collegamenti


---

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