For the complete documentation index, see llms.txt. This page is also available as Markdown.

New-PSUSchedule

Creates a new schedule within PSU.

SYNOPSIS

Creates a new schedule within PSU.

SYNTAX

Script-Cron (Default)

New-PSUSchedule [-Script] <Script> [-Cron] <String> [-Credential <Variable>] [-TimeZone <String>]
 [-Environment <String>] [-Name <String>] [-Paused] [-RandomDelay] [-RandomDelayMaximum <Int32>]
 [-Timeout <Int32>] [-Condition <ScriptBlock>] [-Folder <String>] [-Description <String>] [-Computer <String>]
 [-Parameters <Hashtable>] [-AvailableInBranch <String[]>] [-ComputerName <String>] [-AppToken <String>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]

Script-Continuous

New-PSUSchedule [-Script] <Script> [-Credential <Variable>] [-TimeZone <String>] [-Continuous]
 [-Delay <TimeSpan>] [-DelaySecond <Int32>] [-DelayMinute <Int32>] [-DelayHour <Int32>] [-Environment <String>]
 [-Name <String>] [-Paused] [-RandomDelay] [-RandomDelayMaximum <Int32>] [-Timeout <Int32>]
 [-Condition <ScriptBlock>] [-Folder <String>] [-Description <String>] [-Computer <String>]
 [-Parameters <Hashtable>] [-AvailableInBranch <String[]>] [-ComputerName <String>] [-AppToken <String>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]

Script-OneTime

Script-EveryHour

Script-EveryDay

Script-DayOfWeek

Script-EveryMonth

Script-SpecificMonth

Workflow-Cron

Workflow-Continuous

Workflow-OneTime

Workflow-EveryHour

Workflow-EveryDay

Workflow-DayOfWeek

Workflow-EveryMonth

Workflow-SpecificMonth

DESCRIPTION

Creates a new schedule within PSU. Schedules allow you to automate when jobs run and run jobs continuously.

EXAMPLES

Example 1

Creates a new schedule that runs every five minutes.

Example 2

Creates a new schedule that runs every five minutes as 'adam'.

Example 3

Creates a schedule that runs continuously. It will start a new job once the previous one finishes with a delay of 5 minutes inbetween executions.

Example 4

Creates a schedule that runs once in 30 minutes in the 'America/Phoenix' time zone.

PARAMETERS

-AppToken

An app token to access the PSU API.

-ComputerName

The HTTP address of the PSU REST API server.

-Continuous

Runs a job continously with an optional delay between executions.

-Credential

A credential for the user to run the job as. Use New-UACredential to create this credential object.

-Cron

The CRON schedule to use for this schedule.

-Delay

The delay inbetween continous job executions.

-DelayHour

The delay in hours inbetween continous job executions.

-DelayMinute

The delay in minutes inbetween continous job executions.

-DelaySecond

The delay in seconds inbetween continous job executions.

-Script

The script to schedule. Use Get-UAScript to retrieve a script object.

-TimeZone

The TimeZone to execute the script in. By default, it runs in the current user's time zone.

-Environment

The name of the environment to run the script within.

-OneTime

Schedules at a time in the future. The initial time zone is determined by the Kind property of the DateTime object. It the kind is Unknown, it will be assumed to be UTC.

-Description

Description for the schedule.

-Name

Name of the schedule to display in the admin console.

-UseDefaultCredentials

Use default credentials when connecting to the management API

-Condition

A script block that determines whether this schedule should execute. This script block should return $true or $false.

-Integrated

Executes the command internally rather than using the Management API. Only works when running script from within PowerShell Universal.

-Paused

Whether this schedule is paused.

-Timeout

The timeout in minutes for this schedule.

-RandomDelay

A random delay will be applied to when this script is started. The random delay will be between 0 and 60 seconds.

-AvailableInBranch

Branches that this schedule will run in.

-Computer

Computer or computer group that will run this schedule.

-Parameters

A hashtable of parameters for this schedule to pass to the target script.

-RandomDelayMaximum

The maximum number of seconds to delay.

-TrustCertificate

Whether the cmdlet should ignore certificate issues.

-Day

The day of the week to run the script.

-DayOfMonth

The day of the month to run the script.

-DayOfWeek

The day of the week to run the script.

-EveryDay

Whether to run the script every day.

-EveryHour

Whether to run the script every hour.

-EveryMonth

Whether to run the script every month.

-Hour

The hour to run the script.

-Minute

The minute to run the script.

-Month

The months to run the script.

-SpecificMonth

Whether to run the script in specific months.

-Folder

The folder in which to store this schedule. This is for visual use only.

-Cookies

Reuses and persists authentication cookies for the current PowerShell session.

-Workflow

Specifies the workflow to target.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters.

INPUTS

UniversalAutomation.Script

OUTPUTS

System.Object

NOTES

Last updated

Was this helpful?