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

# New-PSUSchedule

New-PSUSchedule crea una programación en PowerShell Universal que ejecuta scripts o flujos de trabajo de forma cron, continua, única o según un calendario.

## SINOPSIS

Crea una programación para scripts o flujos de trabajo.

## SINTAXIS

Seleccione `-Script <Script[]>` (alias `-Scripts`; acepta la entrada de la canalización) o `-Workflow <Workflow>`, y una forma de programación:

```powershell
New-PSUSchedule -Script <Script[]> -Cron <String> [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Workflow <Workflow> -Cron <String> [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Script <Script[]> -Continuous [-Delay <TimeSpan>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Workflow <Workflow> -Continuous [-Delay <TimeSpan>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Script <Script[]> [-OneTime <DateTime>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Workflow <Workflow> [-OneTime <DateTime>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Script <Script[]> -EveryHour [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Workflow <Workflow> -EveryHour [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Script <Script[]> -EveryDay [-Hour <Int32>] [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Workflow <Workflow> -EveryDay [-Hour <Int32>] [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Script <Script[]> -DayOfWeek -Day <String[]> [-Hour <Int32>] [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Workflow <Workflow> -DayOfWeek -Day <String[]> [-Hour <Int32>] [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Script <Script[]> -EveryMonth -DayOfMonth <Int32> [-Hour <Int32>] [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Workflow <Workflow> -EveryMonth -DayOfMonth <Int32> [-Hour <Int32>] [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Script <Script[]> -SpecificMonth -Month <String[]> -DayOfMonth <Int32> [-Hour <Int32>] [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
New-PSUSchedule -Workflow <Workflow> -SpecificMonth -Month <String[]> -DayOfMonth <Int32> [-Hour <Int32>] [-Minute <Int32>] [<ScheduleOptions>] [<ConnectionOptions>]
```

`<ScheduleOptions>`: `[-Name <String>] [-Description <String>] [-Credential <Variable>] [-TimeZone <String>] [-Environment <String>] [-Paused] [-RandomDelay] [-RandomDelayMaximum <Int32>] [-Timeout <Int32>] [-Condition <ScriptBlock>] [-Computer <String>] [-Parameters <Hashtable>] [-AvailableInBranch <String[]>] [-Folder <String>]`. Las programaciones continuas también aceptan `[-DelaySecond <Int32>] [-DelayMinute <Int32>] [-DelayHour <Int32>]` como alternativas a `-Delay`. `<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`.

## DESCRIPCIÓN

Programa uno o varios scripts o un flujo de trabajo. Elija un modo de programación: expresión cron, continuo con retraso opcional, fecha única, cada hora, diario, semanal, mensual o meses concretos. `-Parameters` suministra valores al destino, incluidos los scripts de una sola vez sin un bloque `param` declarado. Con un solo script, los parámetros de script declarados también se pueden suministrar de forma dinámica; utilice `-Parameters` si la búsqueda dinámica falla. Aquí, `-Credential` es una variable de credencial de PSU para la ejecución programada, no una credencial de la API de administración.

## EJEMPLOS

```powershell
New-PSUSchedule -Name 'Nightly Cleanup' -Script 'Cleanup.ps1' -Cron '0 0 * * *' -Parameters @{ RetentionDays = 30 }
New-PSUSchedule -Name 'Deploy workflow' -Workflow 'Deploy' -OneTime (Get-Date).AddHours(1) -Parameters @{ Environment = 'Test' }
```

## PARÁMETROS

| Parámetro                                    | Descripción                                                                                             |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `-Script`                                    | Destino o destinos de script, alias `-Scripts`; acepta la entrada de la canalización.                   |
| `-Workflow`                                  | Destino de flujo de trabajo (en lugar de scripts).                                                      |
| `-Cron`                                      | Expresión cron para la forma de programación cron.                                                      |
| `-Continuous`                                | Se ejecuta de forma repetida; de forma opcional, establezca un retraso entre ejecuciones.               |
| `-Delay`                                     | `TimeSpan` entre ejecuciones para las programaciones continuas.                                         |
| `-DelaySecond`, `-DelayMinute`, `-DelayHour` | Retrasos continuos alternativos en segundos, minutos u horas (cada uno establece el mismo retraso).     |
| `-OneTime`                                   | Fecha y hora de la ejecución única.                                                                     |
| `-EveryHour`                                 | Se ejecuta cada hora; `-Minute` elige el minuto.                                                        |
| `-EveryDay`                                  | Se ejecuta cada día; `-Hour` y `-Minute` eligen la hora.                                                |
| `-DayOfWeek`, `-Day`                         | Se ejecuta en los días de la semana especificados; `-Day` es obligatorio con este modo de programación. |
| `-EveryMonth`, `-DayOfMonth`                 | Se ejecuta cada mes en un día del mes obligatorio.                                                      |
| `-SpecificMonth`, `-Month`                   | Se ejecuta solo en los meses especificados; `-Month` y `-DayOfMonth` son obligatorios.                  |
| `-Hour`, `-Minute`                           | Hora y minuto para los modos de programación de calendario.                                             |
| `-Name`                                      | Nombre de programación reutilizable.                                                                    |
| `-Description`                               | Descripción de la programación.                                                                         |
| `-Credential`                                | Variable de credencial de PSU para la ejecución.                                                        |
| `-TimeZone`                                  | Zona horaria de la programación (de forma predeterminada, la zona horaria del sistema).                 |
| `-Environment`                               | Entorno de ejecución del destino.                                                                       |
| `-Paused`                                    | Crea una programación en pausa.                                                                         |
| `-RandomDelay`                               | Agrega un retraso aleatorio.                                                                            |
| `-RandomDelayMaximum`                        | Retraso aleatorio máximo (60 de forma predeterminada).                                                  |
| `-Timeout`                                   | Tiempo de espera de la ejecución programada.                                                            |
| `-Condition`                                 | Bloque de script de condición para la ejecución.                                                        |
| `-Computer`                                  | Ordenador o grupo de ejecución, no la URL del servidor de administración.                               |
| `-Parameters`                                | Tabla hash de los valores de los parámetros del destino.                                                |
| `-AvailableInBranch`                         | Ramas en las que la programación está disponible.                                                       |
| `-Folder`                                    | Carpeta de la programación.                                                                             |
| `-ComputerName`                              | URL o nombre de host de la API de administración de 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 `automation.schedules/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-psuschedule.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.
