Share via


Install-AzModule

Install Azure PowerShell modules.

Syntax

Install-AzModule
       [[-Name] <String[]>]
       [-RequiredAzVersion <String>]
       [-Repository <String>]
       [-AllowPrerelease]
       [-UseExactAccountVersion]
       [-Scope <String>]
       [-RemovePrevious]
       [-RemoveAzureRm]
       [-Force]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
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.

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

-Force

Installs modules and overrides the confirmation messages of each step.

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

-Name

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

Type:String[]
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Path

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

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

-RemoveAzureRm

Remove all Azure and AzureRm modules.

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

-RemovePrevious

Remove the module specified installed previously.

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

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

-RequiredAzVersion

Required Az Version.

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

-Scope

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

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

-UseExactAccountVersion

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

Type:SwitchParameter
Position:Named
Default value:False
Required:False
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

Outputs

PSObject[]