Clear-AzConfig

Clears the values of configs that are set by the user.

Note

This is the previous version of our documentation. Please consult the most recent version for up-to-date information.

Syntax

Clear-AzConfig
     [-Force]
     [-PassThru]
     [-AppliesTo <String>]
     [-Scope <ConfigScope>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Clear-AzConfig
     [-PassThru]
     [-AppliesTo <String>]
     [-Scope <ConfigScope>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [-DefaultSubscriptionForLogin]
     [-DisplayBreakingChangeWarning]
     [-DisplaySurveyMessage]
     [-EnableDataCollection]
     [<CommonParameters>]

Description

Clears the values of configs that are set by the user. By default all the configs will be cleared. You can also specify keys of configs to clear.

Examples

Example 1

Clear-AzConfig -Force

Clear all the configs. -Force suppresses the prompt for confirmation.

Example 2

Clear-AzConfig -EnableDataCollection

Clear the "EnableDataCollection" config.

Parameters

-AppliesTo

Specifies what part of Azure PowerShell the config applies to. Possible values are:

  • "Az": the config applies to all modules and cmdlets of Azure PowerShell.
  • Module name: the config applies to a certain module of Azure PowerShell. For example, "Az.Storage".
  • Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az".
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

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

-DefaultProfile

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

-DefaultSubscriptionForLogin

Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-DisplayBreakingChangeWarning

Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-DisplaySurveyMessage

When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-EnableDataCollection

When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Force

Do not ask for confirmation when clearing all configs.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

Returns true if cmdlet executes correctly.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Scope

Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser.

Type:ConfigScope
Accepted values:CurrentUser, Process
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

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

Inputs

None

Outputs

Boolean