New-​Azure​Automation​Schedule

Creates an Automation schedule.

Syntax

New-AzureAutomationSchedule
   -AutomationAccountName <String>
   -DayInterval <Byte>
   [-Description <String>]
   [-ExpiryTime <DateTimeOffset>]
   -Name <String>
   [-Profile <AzureSMProfile>]
   -StartTime <DateTimeOffset>
   [<CommonParameters>]
New-AzureAutomationSchedule
   -AutomationAccountName <String>
   [-Description <String>]
   [-ExpiryTime <DateTimeOffset>]
   -HourInterval <Byte>
   -Name <String>
   [-Profile <AzureSMProfile>]
   -StartTime <DateTimeOffset>
   [<CommonParameters>]
New-AzureAutomationSchedule
   -AutomationAccountName <String>
   [-Description <String>]
   -Name <String>
   [-OneTime]
   [-Profile <AzureSMProfile>]
   -StartTime <DateTimeOffset>
   [<CommonParameters>]

Description

The New-AzureAutomationSchedule cmdlet creates a schedule in Microsoft Azure Automation.

Examples

Example 1: Create a one-time schedule

PS C:\> New-AzureAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule01" -StartTime "23:00" -OneTime

The following command creates a schedule that runs one time on the current date at 11:00 PM.

Example 2: Create a recurring schedule

PS C:\> $StartTime = Get-Date "13:00:00"
PS C:\> $EndTime = $StartTime.AddYears(1)
PS C:\> New-AzureAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule02" -StartTime $StartTime -ExpiryTime $EndTime -DailyInterval 1

The following commands create a new schedule that runs at 1:00 PM every day for one year starting on the current day.

Required Parameters

-AutomationAccountName

Specifies the name of an Automation account.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DayInterval

Specifies an interval, in days, for the schedule.

Type:Byte
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HourInterval

Specifies an interval, in hours, for the schedule.

Type:Byte
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies a name for the schedule.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-OneTime

Indicates that this operation creates a one-time schedule.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StartTime

Specifies the start time of a schedule. A string can be provided if it can be converted to a valid DateTime.

Type:DateTimeOffset
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Description

Specifies a description.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ExpiryTime

Specifies the expiry time of a schedule. A string can be provided if it can be converted to a valid DateTime.

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

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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

Outputs

Microsoft.Azure.Commands.Automation.Model.Schedule