> 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/es/comandos-de-powershell/new-udlist.md).

# New-UDList

New-UDList crea un contenedor de lista vertical en PowerShell Universal para entradas de texto o imagen añadidas con New-UDListItem, ideal para la navegación en cajones (drawer).

### Sinopsis

Las listas son índices verticales y continuos de texto o imágenes.

### Sintaxis

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

### Descripción

Crea una lista. Utilice New-UDListItem para añadir nuevos elementos a la lista. Las listas son adecuadas para los enlaces en UDDrawers.

### Parámetros

#### -Id

El ID del componente. De forma predeterminada es un GUID aleatorio.

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

#### -Children

Los elementos de la lista.

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

#### -SubHeader

Texto que se muestra dentro del subencabezado.

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

#### -ClassName

Una clase CSS que se aplica a la lista.

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

#### -Dense

Indica si la lista es densa.

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

#### -Sx

Una tabla hash de estilos que se aplican a este 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
```

#### Parámetros comunes

Este cmdlet admite los parámetros comunes: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable y OutVariable. Para más información, consulte [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Salidas

### Ejemplos

#### Ejemplo 1: lista básica

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

Una lista básica de elementos con iconos y un subtítulo.

#### Ejemplo 2: lista densa

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

Una lista densa.

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

Responder a los clics en los elementos de la lista.

#### Ejemplo 4: acción secundaria

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

Responder a las acciones secundarias en los elementos de la lista.

#### Ejemplo 5: elementos de lista anidados

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

Crear elementos de lista anidados.

#### Ejemplo 6: interruptor

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

Crear un elemento de lista con un interruptor.

#### Ejemplo 7: casilla de verificación

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

Crear un elemento de lista con una casilla de verificación.

#### Ejemplo 8: enlaces

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

Crear un elemento de lista con enlaces


---

# 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/es/comandos-de-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.
