Share via


Install-AzModule

Install Azure PowerShell modules.

Syntax

Default (Default)

Install-AzModule
    [[-Name] <String[]>]
    [-RequiredAzVersion <String>]
    [-Repository <String>]
    [-AllowPrerelease]
    [-UseExactAccountVersion]
    [-Scope <String>]
    [-RemovePrevious]
    [-RemoveAzureRm]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByPath

Install-AzModule
    -Path <String>
    [-Scope <String>]
    [-RemovePrevious]
    [-RemoveAzureRm]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Install Azure PowerShell modules.

Examples

EXAMPLE 1

Install-AzModule -Repository PSGallery

EXAMPLE 2

Install-AzModule Storage,Compute,Network -Repository PSGallery -AllowPrerelease

EXAMPLE 3

Install-AzModule -Path https://my.repo.com/Az.Accounts.2.5.0.nupkg

Parameters

-AllowPrerelease

Allow preview modules to be installed.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

Default
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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

-Force

Installs modules and overrides the confirmation messages of each step.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

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

-Name

Az modules to install. Can be the names without Az. prefix.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Default
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Path

The url or local path of a nuget package to install the module from.

Parameter properties

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

Parameter sets

ByPath
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveAzureRm

Remove all Azure and AzureRm modules.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

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

-RemovePrevious

Remove the module specified installed previously.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

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

-Repository

The Registered Repository to install module from. If only one repository is registered in PowerShell, Install-AzModule will use it. If more than one, please specify the Repository.

Parameter properties

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

Parameter sets

Default
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RequiredAzVersion

Required Az Version.

Parameter properties

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

Parameter sets

Default
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Scope

Scope to install modules. Default value is CurrentUser for all the PowerShell platforms. Accepted values: CurrentUser, AllUser.

Parameter properties

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

Parameter sets

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

-UseExactAccountVersion

Use the exact Az.Accounts version that meet the mininum requirement from the Az modules to install.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

Default
Position:Named
Mandatory:False
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.

Outputs

PSObject