New-AzureSqlJobSchedule

Creates a time based specification for a job run to take place either on a reoccurring interval or at a single time.

Syntax

New-AzureSqlJobSchedule
   -ScheduleName <String>
   [-StartTime <DateTimeOffset>]
   [-EndTime <DateTimeOffset>]
   [-OneTime]
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   [<CommonParameters>]
New-AzureSqlJobSchedule
   -ScheduleName <String>
   [-StartTime <DateTimeOffset>]
   [-EndTime <DateTimeOffset>]
   -MinuteInterval <Int32>
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   [<CommonParameters>]
New-AzureSqlJobSchedule
   -ScheduleName <String>
   [-StartTime <DateTimeOffset>]
   [-EndTime <DateTimeOffset>]
   -HourInterval <Int32>
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   [<CommonParameters>]
New-AzureSqlJobSchedule
   -ScheduleName <String>
   [-StartTime <DateTimeOffset>]
   [-EndTime <DateTimeOffset>]
   -DayInterval <Int32>
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   [<CommonParameters>]
New-AzureSqlJobSchedule
   -ScheduleName <String>
   [-StartTime <DateTimeOffset>]
   [-EndTime <DateTimeOffset>]
   -WeekInterval <Int32>
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   [<CommonParameters>]
New-AzureSqlJobSchedule
   -ScheduleName <String>
   [-StartTime <DateTimeOffset>]
   [-EndTime <DateTimeOffset>]
   -MonthInterval <Int32>
   [[-AzureSqlJobConnection] <AzureSqlJobConnection>]
   [<CommonParameters>]

Description

The New-AzureSqlJobSchedule cmdlet creates a time based specification for a job run to take place either on a reoccurring interval or at a single time.

Jobs can be set to run according to a schedule through the creation of a trigger through the New-AzureSqlJobTrigger cmdlet.

Examples

Example 1: Create a schedule with a time trigger

PS C:\>New-AzureSqlJobSchedule -ScheduleName "MyOneMinuteIntervalSchedule" -StartTime (Get-Date).ToUniversalTime() -MinuteInterval 1
ScheduleName                  Interval                      StartTime                     EndTime
------------                  --------                      ---------                     -------
MyOneMinuteIntervalSchedule   Minutes: 1                    7/4/2015 7:00:00 AM -07:00    12/31/9999 3:59:59 PM -08:00

This command creates a schedule to be triggered every one minute.

Example 2: Create a schedule with a trigger of one hour

PS C:\>New-AzureSqlJobSchedule -ScheduleName "MyOneHourIntervalSchedule" -MinuteInterval 1
ScheduleName                  Interval                      StartTime                     EndTime
------------                  --------                      ---------                     -------
MyOneHourIntervalSchedule     Hours: 1                      7/4/2015 7:00:00 AM -07:00    12/31/9999 3:59:59 PM -08:00

This command creates a schedule to be triggered every one hour.

Example 3: Create a schedule with a trigger of one day

PS C:\>New-AzureSqlJobSchedule -ScheduleName "MyOneHourIntervalSchedule" -DayInterval 1
ScheduleName                  Interval                      StartTime                     EndTime
------------                  --------                      ---------                     -------
MyOneDayIntervalSchedule      Days: 1                       7/4/2015 7:00:00 AM -07:00    12/31/9999 3:59:59 PM -08:00

This command creates a schedule to be triggered every one day.

Example 4: Create a schedule that is triggered at a specific time

PS C:\>New-AzureSqlJobSchedule -ScheduleName "MyOneTimeSchedule" -StartTime (New-Object -TypeName System.DateTime -ArgumentList (2015, 07, 15, 07, 00, 00)).ToUniversalTime() -OneTime
ScheduleName                  Interval                      StartTime                     EndTime
------------                  --------                      ---------                     -------
MyOneTimeSchedule             OneTime                       7/15/2015 7:00:00 AM -07:00   12/31/9999 3:59:59 PM -08:00

This command creates a schedule to be triggered once at the provided start time.

Parameters

-AzureSqlJobConnection

Specifies the connection state object for the job. You can get the connection state object through the New-AzureSqlJobConnection cmdlet. If you do not specify this parameter, the connection state is used from a prior call to the Use-AzureSqlJobConnection cmdlet.

Type:AzureSqlJobConnection
Position:1
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DayInterval

Specifies the number of days to allow to elapse between jobs.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-EndTime

Specifies the ending time for the schedule to be active.

Type:DateTimeOffset
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HourInterval

Specifies the number of hours to allow to elapse between jobs.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MinuteInterval

Specifies the number of minutes to allow to elapse between jobs.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MonthInterval

Specifies the number of months to allow to elapse between jobs.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-OneTime

Indicates that the schedule will only run once on the specified start time.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ScheduleName

Specifies the name of the schedule.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StartTime

Specifies the starting time for the schedule to be active.

Type:DateTimeOffset
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WeekInterval

Specifies the number of weeks to allow to elapse between jobs.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False