Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
New-AzSqlInstanceStartStopSchedule
- Module:
- Az.Sql Module
Creates start/stop schedule for Azure SQL Managed Instance
Syntax
NewInstanceScheduleInputParameters (Default)
New-AzSqlInstanceStartStopSchedule
[-ResourceGroupName] <String>
-InstanceName <String>
-TimeZone <String>
-ScheduleList <ScheduleItem[]>
[-Description <String>]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
NewInstanceScheduleByInstanceModelInputParameters
New-AzSqlInstanceStartStopSchedule
[-ResourceGroupName] <String>
-TimeZone <String>
-ScheduleList <ScheduleItem[]>
-InstanceModel <AzureSqlManagedInstanceModel>
[-Description <String>]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Creates start/stop schedule for Azure SQL Managed Instance
Examples
Example 1
$newSchedule = New-AzSqlInstanceScheduleItem -StartDay Monday -StopDay Friday -StartTime "09:00" -StopTime "17:00"
New-AzSqlInstanceStartStopSchedule -InstanceName managed-instance-v2 -ResourceGroupName CustomerExperienceTeam_RG -ScheduleList $newSchedule -TimeZone "Central Europe Standard Time"
Creates new start/stop schedule that starts at Monday 9 AM and stops at Friday 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
New-AzSqlInstanceStartStopSchedule -InstanceName managed-instance-v2 -ResourceGroupName CustomerExperienceTeam_RG -ScheduleList $newSchedule -TimeZone "Central Europe Standard Time"
Updates existing start/stop schedule with new schedule item starts at Monday 9 AM and stops at Friday 5 PM.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
-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
-Description
The description of the schedule.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Force
Skip confirmation message for performing the action
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-InstanceModel
Instance model input object.
Parameter properties
| Type: | AzureSqlManagedInstanceModel |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-InstanceName
The name of the Azure SQL Managed Instance
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceGroupName
The name of the resource group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ScheduleList
Array of valid ScheduleItem objects.
Parameter properties
| Type: | ScheduleItem[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-TimeZone
The name of the timezone for the schedule. Please refer to https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-timezone?view=powershell-7.3#examples for valid values.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
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.
Inputs
String
AzureSqlManagedInstanceModel
Outputs
AzureSqlManagedInstanceScheduleModel
Related Links
Azure PowerShell
Feedback
Was this page helpful?
