Edit

Share via


Add-AzTrafficManagerCustomHeaderToProfile

Adds custom header information to a local Traffic Manager profile object.

Syntax

Default (Default)

Add-AzTrafficManagerCustomHeaderToProfile
    -Name <String>
    -Value <String>
    -TrafficManagerProfile <TrafficManagerProfile>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Add-AzTrafficManagerCustomHeaderToProfile cmdlet adds custom header information 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 custom header information to a profile

$TrafficManagerProfile = Get-AzTrafficManagerProfile -Name "ContosoProfile" -ResourceGroupName "ResourceGroup11"
Add-AzTrafficManagerCustomHeaderToProfile -TrafficManagerProfile $TrafficManagerProfile -Name "host" -Value "www.contoso.com"
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 custom header information to the profile stored in $TrafficManagerProfile. The final command updates the profile in Traffic Manager to match the local value in $TrafficManagerProfile.

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

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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

-Name

Specifies the name of the custom header information to be added.

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

-TrafficManagerProfile

Specifies a local TrafficManagerProfile object. This cmdlet modifies this local object. To obtain a TrafficManagerProfile object, use the Get-AzTrafficManagerProfile cmdlet.

Parameter properties

Type:TrafficManagerProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Value

Specifies the value of the custom header information to be added.

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

-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

(All)
Position:Named
Mandatory:False
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.

Inputs

TrafficManagerProfile

Outputs

TrafficManagerProfile