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

# New-PSUSchedule

New-PSUSchedule creates a schedule in PowerShell Universal that runs scripts or workflows on a cron, continuous, one-time, or calendar basis.

## SYNOPSIS

Creates a schedule for scripts or workflows.

## SYNTAX

Select either `-Script <Script[]>` (alias `-Scripts`; accepts pipeline input) or `-Workflow <Workflow>`, and one timing form:

```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>]`. Continuous schedules also accept `[-DelaySecond <Int32>] [-DelayMinute <Int32>] [-DelayHour <Int32>]` as alternatives to `-Delay`. `<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`.

## DESCRIPTION

Schedules one or more scripts or a workflow. Choose a timing mode: cron expression, continuous with optional delay, one-time date, hourly, daily, weekly, monthly, or specific months. `-Parameters` supplies values to the target, including one-time scripts with no declared `param` block. With one script, declared script parameters may also be supplied dynamically; use `-Parameters` if dynamic lookup fails. Here `-Credential` is a PSU credential variable for the scheduled run, not a Management API credential.

## EXAMPLES

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

## PARAMETERS

| Parameter                                    | Description                                                                             |
| -------------------------------------------- | --------------------------------------------------------------------------------------- |
| `-Script`                                    | Script target(s), alias `-Scripts`; accepts pipeline input.                             |
| `-Workflow`                                  | Workflow target (instead of scripts).                                                   |
| `-Cron`                                      | Cron expression for the cron timing form.                                               |
| `-Continuous`                                | Runs repeatedly; optionally set an inter-run delay.                                     |
| `-Delay`                                     | Inter-run `TimeSpan` for continuous schedules.                                          |
| `-DelaySecond`, `-DelayMinute`, `-DelayHour` | Alternative continuous delays in seconds, minutes, or hours (each sets the same delay). |
| `-OneTime`                                   | Date and time to run once.                                                              |
| `-EveryHour`                                 | Runs hourly; `-Minute` chooses the minute.                                              |
| `-EveryDay`                                  | Runs daily; `-Hour` and `-Minute` choose the time.                                      |
| `-DayOfWeek`, `-Day`                         | Runs on specified weekdays; `-Day` is required with this timing mode.                   |
| `-EveryMonth`, `-DayOfMonth`                 | Runs monthly on a required day of month.                                                |
| `-SpecificMonth`, `-Month`                   | Runs only in specified months; `-Month` and `-DayOfMonth` are required.                 |
| `-Hour`, `-Minute`                           | Hour and minute for calendar timing modes.                                              |
| `-Name`                                      | Reusable schedule name.                                                                 |
| `-Description`                               | Schedule description.                                                                   |
| `-Credential`                                | PSU credential variable for execution.                                                  |
| `-TimeZone`                                  | Schedule time zone (defaults to the system time zone).                                  |
| `-Environment`                               | Execution environment for the target.                                                   |
| `-Paused`                                    | Creates a paused schedule.                                                              |
| `-RandomDelay`                               | Adds a random delay.                                                                    |
| `-RandomDelayMaximum`                        | Maximum random delay (defaults to 60).                                                  |
| `-Timeout`                                   | Scheduled run timeout.                                                                  |
| `-Condition`                                 | Script block condition for execution.                                                   |
| `-Computer`                                  | Execution computer or group, not the management server URL.                             |
| `-Parameters`                                | Hashtable of target parameter values.                                                   |
| `-AvailableInBranch`                         | Branches in which the schedule is available.                                            |
| `-Folder`                                    | Schedule folder.                                                                        |
| `-ComputerName`                              | Target PSU Management API URL or host name (alias `-Uri`).                              |
| `-AppToken`                                  | Management API app token.                                                               |
| `-UseDefaultCredentials`                     | Uses current Windows credentials.                                                       |
| `-Integrated`                                | Uses the in-process management client.                                                  |
| `-TrustCertificate`                          | Ignores certificate validation errors.                                                  |
| `-Cookies`                                   | Reuses session authentication cookies.                                                  |

## PERMISSIONS

The access token requires `automation.schedules/create` to run this cmdlet remotely.


---

# 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/powershell-commands/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.
