Run the code blocks in one of the following sections to update or install the latest version of the Azure PowerShell modules from the PSGallery:
Expand |
---|
Info |
---|
This will perform the following actions for each PowerShell module: |
Unload Graph PowerShell modules respecting dependency on Microsoft.Graph.Authentication Code Block |
---|
# get loaded modules with base module split out
$Modules, $BaseModule = (Get-Module -Name 'Az.*').Where({$_.Name -ne 'Az.Accounts'},[System.Management.Automation.WhereOperatorSelectionMode]::Split)
# unload modules with base module last
$Modules | ForEach-Object { Remove-Module -Name $_.Name -Force }; $BaseModule | ForEach-Object { Remove-Module -Name $_.Name -Force } |
Update Graph PowerShell modules Code Block |
---|
Get-Module -ListAvailable -Name Az.* | ForEach-Object { Update-Module -Name $_.Name } |
|
...