Open PowerShell 7 as an administrator by right-clicking on it and selecting "Run as administrator".
Install-Module -Name Az -AllowClobber -Scope CurrentUser
Import-Module Az
Remember that the correct cmdlets to use with the Az
module are Get-AzAccount
and Get-AzSubscription
. The cmdlets you mentioned (Get-AzureContext
, Get-Account
, and Get-Subscription
) are not valid cmdlets in the Az
module.
If you still encounter issues, make sure you have the latest version of the Az
module installed by running:
Update-Module -Name Az