Redigera

Dela via


New-AzSqlInstanceScheduleItem

Helper command for creating ScheduleItem object that is uses for New-AzSqlInstanceStartStopSchedule cmdlet

Syntax

New-AzSqlInstanceScheduleItem
   -StartDay <DayOfWeek>
   -StartTime <String>
   -StopDay <DayOfWeek>
   -StopTime <String>
   [-ScheduleList <ScheduleItem[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Creates ScheduleItem object used for creating start/stop schedule on Azure SQL Managed Instance.

Examples

Example 1

$sc = New-AzSqlInstanceScheduleItem -StartDay Monday -StopDay Friday -StartTime "09:00" -StopTime "17:00"

Creates one schedule item thats starts on Monday at 9 AM and stops on Friday at 5 PM.

Example 2

$mi = Get-AzSqlInstanceStartStopSchedule -InstanceName instance-name -ResourceGroupName rg-name

$existingSchedule = $mi.ScheduleList

$newSchedule = New-AzSqlInstanceScheduleItem -StartDay Monday -StopDay Friday -StartTime "09:00" -StopTime "17:00" -ScheduleList $existingSchedule

Appends one more schedule item thats starts on Monday at 9 AM and stops on Friday at 5 PM on the existing schedule of the instance-name Azure SQL Managed Instance.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ScheduleList

Existing schedule items to append new one on.

Type:ScheduleItem[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-StartDay

Start day for schedule

Type:DayOfWeek
Accepted values:Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StartTime

Start time for schedule

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

-StopDay

Stop day for schedule

Type:DayOfWeek
Accepted values:Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StopTime

Stop time for schedule

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

Inputs

ScheduleItem[]

Outputs

ScheduleItem