Editar

Compartilhar via


Import-AzConfig

Imports configs from a file that was previously exported by Export-AzConfig.

Syntax

Import-AzConfig
      [-Path] <String>
      [-PassThru]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Import-AzConfig cmdlet imports all the configs from a file that was previously exported by Export-AzConfig. The imported configs will be set at the "CurrentUser" scope, so they are consistent across PowerShell sessions.

During importing, if a config that is to be imported has already been set, its value will be overwritten.

Examples

Example 1

Import-AzConfig -Path ./config.json

This example imports configs from file ./config.json.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

Returns a boolean value indicating success or failure.

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

-Path

Specifies the path to configuration saved by using Export-AzConfig.

Type:String
Position:1
Default value:None
Required:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Boolean