如何获取我通过 PowerShell 登录的 Azure 目录(租户)名称?
我已尝试“Get-AzContext”,但它仅提供租户 ID。输出中不包含租户名称或默认域名。
最佳答案
Get-AzTenant
会有所帮助。
Get-AzTenant
[[-TenantId] <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
确保Az的版本是4.5.0(最新版本)。
您可以Install-Module -Name Az
来更新它。
关于azure - 通过 PowerShell 获取 Azure 目录名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63353305/