New-AzSqlInstanceScheduleItem
Helper command for creating ScheduleItem object that is uses for New-AzSqlInstanceStartStopSchedule cmdlet
Syntax
Default (Default)
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.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ScheduleList
Existing schedule items to append new one on.
Parameter properties
| Type: | ScheduleItem[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-StartDay
Start day for schedule
Parameter properties
| Type: | DayOfWeek |
| Default value: | None |
| Accepted values: | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-StartTime
Start time for schedule
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-StopDay
Stop day for schedule
Parameter properties
| Type: | DayOfWeek |
| Default value: | None |
| Accepted values: | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-StopTime
Stop time for schedule
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.