Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Run the following commands to define the name of the PowerShell module and any prerequisite modules:

Code Block
languagepowershell
$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
languagepowershell
$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
    languagepowershell
    Get-Module -ListAvailable -Name Az"$Name.*" | ForEach-Object { Update-Module -Name $_.Name } 
  • To install or reinstall the modules:

    Code Block
    languagepowershell
    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:

Code Block
languagepowershell
Update-AzConfig -EnableLoginByWam $false

...