...
Run the following commands to define the name of the PowerShell module and any prerequisite modules:
Code Block | ||
---|---|---|
| ||
$Name = 'Az'
$PrerequisiteModuleNames = 'Az.Accounts' |
Run the following commands to define the Azure PowerShell modules respecting the dependency on the Az.Accounts module:
Code Block | ||
---|---|---|
| ||
$Modules, $BaseModule = (Get-Module -Name 'Az"$Name.*'").Where({$_.Name -ne 'Az.Accounts'notin $PrerequisiteModuleNames},[System.Management.Automation.WhereOperatorSelectionMode]::Split) |
...
To update the modules:
Code Block language powershell Get-Module -ListAvailable -Name Az"$Name.*" | ForEach-Object { Update-Module -Name $_.Name }
To install or reinstall the modules:
Code Block language powershell Save-Module -Path "$env:ProgramFiles\WindowsPowerShell\Modules" -Name Az$Name -Force
Note | |||||
---|---|---|---|---|---|
There is a bug in version 3.0.0 of the Az.Accounts module that prevents sign in to Azure via the Web Account Manager (WAM) on Windows. Run the following commands to disable the login via WAM functionality:
|
...