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

# New-UDList

New-UDList crée un conteneur de liste verticale dans PowerShell Universal pour des entrées de texte ou d'image ajoutées avec New-UDListItem, idéal pour la navigation dans les drawers.

### Résumé

Les listes sont des index continus et verticaux de texte ou d'images.

### Syntaxe

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

### Description

Crée une liste. Utilisez New-UDListItem pour ajouter de nouveaux éléments à la liste. Les listes conviennent bien aux liens dans les UDDrawers.

### Paramètres

#### -Id

L'ID du composant. Sa valeur par défaut est un GUID aléatoire.

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

#### -Children

Les éléments de la liste.

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

#### -SubHeader

Texte à afficher dans le sous-en-tête.

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

#### -ClassName

Une classe CSS à appliquer à la liste.

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

#### -Dense

Indique si la liste est dense.

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

#### -Sx

Une table de hachage de styles à appliquer à ce composant.

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

#### 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'informations, consultez [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Sorties

### Exemples

#### Exemple 1 : Liste de 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'
```

Une liste de base d'éléments avec des icônes et un sous-titre.

#### Exemple 2 : Liste dense

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

Une liste dense.

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

Répondre aux clics sur les éléments de la liste.

#### Exemple 4 : Action secondaire

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

Répondre aux actions secondaires sur les éléments de la liste.

#### Exemple 5 : Éléments de liste imbriqués

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

Créer des éléments de liste imbriqués.

#### Exemple 6 : Interrupteur

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

Créer un élément de liste avec un interrupteur.

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

Créer un élément de liste avec une case à cocher.

#### Exemple 8 : Liens

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

Créer un élément de liste avec des liens


---

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