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

# New-PSUEnvironment

New-PSUEnvironment crea un entorno de ejecución de PowerShell en PowerShell Universal, definiendo el runspace, los módulos y el script de inicio.

## SINOPSIS

Crea un entorno de ejecución de PowerShell Universal.

## SINTAXIS

```powershell
New-PSUEnvironment -Name <String> [-Version <String>] [-Type <EnvironmentType>] [-Path <String>] [-Arguments <String>] [-Modules <String[]>] [-Variables <String[]>] [-PSModulePath <String[]>] [-StartupScript <String[]>] [-PersistentRunspace] [-RunspaceRecycling] [-MaxRunspaces <Int32>] [-MaxVirtualMemory <Int64>] [-RunspaceSaturationWarningThresholdPercent <Int32>] [-RunspaceSaturationWarningDurationSeconds <Int32>] [-RecycleSchedule <String>] [-Credential <Variable>] [-Description <String>] [-DisableImplicitWinCompat] [-Minimal] [-Disabled] [-ProcessStartupScript <String>] [-EnableDebugger] [-Verb <String>] [-PowerShellVersion <String>] [-Virtual] [-ContainerImageUrl <String>] [-ContainerImageTag <String>] [-ContainerPull] [<ConnectionOptions>] [<CommonParameters>]
```

`<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`. Aquí, `-Credential` es una variable de credencial de PSU para la ejecución, no una credencial de la API de administración.

## DESCRIPCIÓN

Crea un entorno para APIs, scripts, aplicaciones y procesos de seguridad. `-Type` acepta `Custom`, `WindowsPowerShell`, `PowerShell7`, `Isolated` o `Container`. Para `Isolated`, `-PowerShellVersion` acepta una versión instalada o un selector multi-pwsh como `stable`, `preview`, `lts` o `7.4`; `-Virtual` habilita un entorno virtual multi-pwsh administrado. Las opciones de contenedor configuran la URL de la imagen, la etiqueta y si se debe extraer la imagen. `-EnableDebugger` se conserva por compatibilidad, pero ya no es obligatorio y emite una advertencia.

## EJEMPLO

```powershell
New-PSUEnvironment -Name 'Isolated 7.4' -Type Isolated -PowerShellVersion '7.4' -Virtual
```

## PARÁMETROS

| Parámetro                                    | Descripción                                                                                        |
| -------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `-Name`                                      | Nombre de entorno obligatorio.                                                                     |
| `-Version`                                   | Identificador de versión del entorno; de forma predeterminada, su nombre.                          |
| `-Type`                                      | Tipo de entorno: `Custom`, `WindowsPowerShell`, `PowerShell7`, `Isolated` o `Container`.           |
| `-Path`                                      | Ruta del ejecutable del entorno.                                                                   |
| `-Arguments`                                 | Argumentos de proceso adicionales.                                                                 |
| `-Modules`                                   | Módulos configurados para el entorno.                                                              |
| `-Variables`                                 | Nombres de las variables de PSU disponibles para el entorno; el valor predeterminado es `*`.       |
| `-PSModulePath`                              | Rutas de módulos de PowerShell adicionales.                                                        |
| `-StartupScript`                             | Scripts que se ejecutan cuando se inician los runspaces.                                           |
| `-PersistentRunspace`                        | Habilita un runspace persistente.                                                                  |
| `-RunspaceRecycling`                         | Habilita el reciclaje de runspaces.                                                                |
| `-MaxRunspaces`                              | Número máximo de runspaces (25 de forma predeterminada).                                           |
| `-MaxVirtualMemory`                          | Memoria virtual máxima en MB; se convierte en bytes para el almacenamiento.                        |
| `-RunspaceSaturationWarningThresholdPercent` | Porcentaje del umbral de advertencia de saturación de runspaces (80 de forma predeterminada).      |
| `-RunspaceSaturationWarningDurationSeconds`  | Duración de la advertencia de saturación, en segundos (30 de forma predeterminada).                |
| `-RecycleSchedule`                           | Programación para reciclar los runspaces.                                                          |
| `-Credential`                                | Variable de credencial de PSU para la ejecución, no un `PSCredential` de la API de administración. |
| `-Description`                               | Descripción del entorno.                                                                           |
| `-DisableImplicitWinCompat`                  | Desactiva la compatibilidad implícita con Windows.                                                 |
| `-Minimal`                                   | Habilita un inicio mínimo del entorno.                                                             |
| `-Disabled`                                  | Crea el entorno deshabilitado.                                                                     |
| `-ProcessStartupScript`                      | Script que se ejecuta al iniciar el proceso.                                                       |
| `-EnableDebugger`                            | Conmutador de compatibilidad heredado; ahora solo emite una advertencia.                           |
| `-Verb`                                      | Verbo utilizado para iniciar el ejecutable.                                                        |
| `-PowerShellVersion`                         | Versión de PowerShell instalada o selector multi-pwsh para entornos aislados.                      |
| `-Virtual`                                   | Habilita un entorno virtual administrado.                                                          |
| `-ContainerImageUrl`                         | URL de la imagen de contenedor.                                                                    |
| `-ContainerImageTag`                         | Etiqueta de la imagen de contenedor.                                                               |
| `-ContainerPull`                             | Extrae la imagen de contenedor configurada.                                                        |
| `-ComputerName`                              | URL o nombre de host del servidor PSU de destino (alias `-Uri`).                                   |
| `-AppToken`                                  | Token de aplicación de la API de administración.                                                   |
| `-UseDefaultCredentials`                     | Usa las credenciales actuales de Windows.                                                          |
| `-Integrated`                                | Usa el cliente de administración en proceso.                                                       |
| `-TrustCertificate`                          | Ignora los errores de validación del certificado.                                                  |
| `-Cookies`                                   | Reutiliza las cookies de autenticación de la sesión.                                               |

## PERMISOS

El token de acceso requiere `settings.environments/create` para ejecutar este cmdlet de forma remota.


---

# 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-universal/es/comandos-de-powershell/new-psuenvironment.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.
