Add-AzTrafficManagerExpectedStatusCodeRange
Adds an expected status code range to a local Traffic Manager profile object.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Add-AzTrafficManagerExpectedStatusCodeRange
-Min <Int32>
-Max <Int32>
-TrafficManagerProfile <TrafficManagerProfile>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Add-AzTrafficManagerExpectedStatusCodeRange cmdlet adds a range of expected status codes to a local Azure Traffic Manager profile object. You can get a profile by using the New-AzTrafficManagerProfile or Get-AzTrafficManagerProfile cmdlets.
This cmdlet operates on the local profile object. Commit your changes to the profile for Traffic Manager by using the Set-AzTrafficManagerProfile cmdlet.
Examples
Example 1: Add an expected status code range to a profile
PS C:\> $TrafficManagerProfile = Get-AzTrafficManagerProfile -Name "ContosoProfile" -ResourceGroupName "ResourceGroup11"
PS C:\> Add-AzTrafficManagerExpectedStatusCodeRange -TrafficManagerProfile $TrafficManagerProfile -Min 200 -Max 499
PS C:\> Set-AzTrafficManagerProfile -TrafficManagerProfile $TrafficManagerProfile
The first command gets an Azure Traffic Manager profile by using the Get-AzTrafficManagerProfile cmdlet. The command stores the local profile in the $TrafficManagerProfile variable. The second command adds an expected status code range to the profile stored in $TrafficManagerProfile. The final command updates the profile in Traffic Manager to match the local value in $TrafficManagerProfile.
Parameters
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the highest value in the status code range to be added.
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the lowest value in the status code range to be added.
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies a local TrafficManagerProfile object. This cmdlet modifies this local object. To obtain a TrafficManagerProfile object, use the Get-AzTrafficManagerProfile cmdlet.
| Type: | TrafficManagerProfile |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |