> 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/es/powershell-commands/new-rdmport.md).

# New-RDMPort

New-RDMPort genera uno o varios números de puerto en Remote Desktop Manager según el rango especificado y las reglas de exclusión.

### Sinopsis

Generar número(s) de puerto según los parámetros especificados.

### Sintaxis

#### \_\_AllParameterSets

```
New-RDMPort [-Count <int>] [-ExcludePort <int[]>] [-IncludeWellKnownPorts] [-IncludeRegisteredPorts]
 [-IncludePortsUsedByOthersSessions] [-Maximum <int>] [-Minimum <int>]
 [-ForcePromptAnswer <DialogResult[]>] [<CommonParameters>]
```

### Descripción

Generar número(s) de puerto según los parámetros especificados.

### Ejemplos

#### Ejemplo 1

```powershell
PS C:\> $port = New-RDMPort -Minimum 50 -Maximum 2048 -IncludeWellKnownPorts -IncludeRegisteredPorts -IncludePortsUsedByOthersSessions
```

Genera un puerto entre 50 y 2048. El puerto puede estar ya en uso por otra sesión, o ser un puerto bien conocido o registrado.

#### Ejemplo 2

```powershell
PS C:\> $port = New-RDMPort -Minimum 10 -Maximum 15 -IncludeWellKnownPorts -IncludeRegisteredPorts -ExcludePort 11,12,13
```

El puerto tendrá un valor de 10, 14 o 15. Si otra sesión utiliza uno de los puertos, ese puerto se excluirá de las posibilidades.

#### Ejemplo 3

```powershell
PS C:\> $ports = New-RDMPort -Count 10
```

Se generarán 10 puertos y se almacenarán en $ports.

#### Ejemplo 4

```powershell
PS C:\> $sess = Get-RDMSession -Name ARemotePwsh; $sess.PowerShell.Port = New-RDMPort -Minimum 1024; Set-RDMSession -Session $sess -Refresh
```

El usuario obtiene una sesión de powershell remoto existente llamada ARemotePwsh y cambia su puerto. El nuevo puerto es de al menos 1024, no es un puerto bien conocido, no es un puerto registrado y no está utilizado por otras sesiones. El usuario guarda la modificación.

### Parámetros

#### -Count

Número de puertos que se van a generar. El valor predeterminado es 1.

```yaml
Type: System.Int32
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -ExcludePort

Estos puertos no se generarán.

```yaml
Type: System.Int32[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -ForcePromptAnswer

Modificador que debe utilizarse con precaución. Responderá automáticamente a los mensajes que planteen preguntas de sí/no, sí/no/cancelar u ok/cancelar. En caso de varios mensajes, se pueden pasar varios valores a este parámetro. Estos son los valores aceptados:

* Yes: Acepta el mensaje. Cubre el valor OK y Automatic.
* No: Rechaza el mensaje de sí/no/cancelar. "Cancel" es la opción alternativa si no existe la opción "No".
* Cancel: Cancela el mensaje de sí/no/cancelar. "No" es la opción alternativa si no existe la opción "Cancel".

```yaml
Type: System.Windows.Forms.DialogResult[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -IncludePortsUsedByOthersSessions

Permite que se generen puertos utilizados por otras sesiones.

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -IncludeRegisteredPorts

Permite que se generen puertos registrados. Para obtener una lista de puertos registrados, consulte: <https://en.wikipedia.org/wiki/List\\_of\\_TCP\\_and\\_UDP\\_port\\_numbers#Registered\\_ports>

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -IncludeWellKnownPorts

Permite que se generen puertos bien conocidos. Para obtener una lista de puertos bien conocidos, consulte: <https://en.wikipedia.org/wiki/List\\_of\\_TCP\\_and\\_UDP\\_port\\_numbers#Well-known\\_ports>

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Maximum

Valor máximo de puerto generado. De forma predeterminada, el límite se establece en el máximo absoluto 65 535.

```yaml
Type: System.Int32
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Minimum

Valor mínimo de puerto generado. De forma predeterminada, el límite se establece en 0. Un valor recomendado es 1024.

```yaml
Type: System.Int32
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### CommonParameters

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

### Notas

Para obtener más información, escriba "Get-Help New-RDMPort -detailed". Para obtener información técnica, escriba "Get-Help New-RDMPort -full".


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell/es/powershell-commands/new-rdmport.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
