Add-AzTrafficManagerExpectedStatusCodeRange
将预期的状态代码范围添加到本地流量管理器配置文件对象。
语法
Default (默认值)
Add-AzTrafficManagerExpectedStatusCodeRange
-Min <Int32>
-Max <Int32>
-TrafficManagerProfile <TrafficManagerProfile>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Add-AzTrafficManagerExpectedStatusCodeRange cmdlet 将一系列预期的状态代码添加到本地 Azure 流量管理器配置文件对象。
可以使用 New-AzTrafficManagerProfile 或 Get-AzTrafficManagerProfile cmdlet 获取配置文件。
此 cmdlet 对本地配置文件对象进行作。
使用 Set-AzTrafficManagerProfile cmdlet 将更改提交到流量管理器的配置文件。
示例
示例 1:将预期的状态代码范围添加到配置文件
$TrafficManagerProfile = Get-AzTrafficManagerProfile -Name "ContosoProfile" -ResourceGroupName "ResourceGroup11"
Add-AzTrafficManagerExpectedStatusCodeRange -TrafficManagerProfile $TrafficManagerProfile -Min 200 -Max 499
Set-AzTrafficManagerProfile -TrafficManagerProfile $TrafficManagerProfile
第一个命令使用 Get-AzTrafficManagerProfile cmdlet 获取 Azure 流量管理器配置文件。
该命令将本地配置文件存储在$TrafficManagerProfile变量中。
第二个命令将预期的状态代码范围添加到存储在$TrafficManagerProfile中的配置文件。
最后一个命令更新流量管理器中的配置文件,以匹配$TrafficManagerProfile中的本地值。
参数
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Max
指定要添加的状态代码区域中的最高值。
参数属性
| 类型: | Int32
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Min
指定要添加的状态代码范围中的最低值。
参数属性
| 类型: | Int32
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-TrafficManagerProfile
指定本地 TrafficManagerProfile 对象。
此 cmdlet 修改此本地对象。
若要获取 TrafficManagerProfile 对象,请使用 Get-AzTrafficManagerProfile cmdlet。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 命令脚本未运行。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输出