我需要通过 cmdlet 代码查找已安装的 Azure PowerShell 版本。如何查找 Azure PowerShell 版本?
注意:除了 cmdlet 之外,也欢迎使用其他代码。
最佳答案
此 PowerShell cmdlet 将获取 Azure PowerShell 版本。
Get-Module -ListAvailable -Name Azure -Refresh
它有一个主要优点,即使 Azure 模块尚未加载到当前 PowerShell session 中,它也能够返回预期结果。
相反,(Get-Module Azure).Version
仅当 Azure 模块之前已加载到当前 PowerShell session 中时才起作用,即通过从 Azure 模块中调用任何 cmdlet当前的 PowerShell session ,例如获取AzureStorageAccount
关于powershell - 如何查找 Azure PowerShell 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34157067/