powershell - 如何查找 Azure PowerShell 版本?

标签 powershell azure version powershell-cmdlet azure-powershell

我需要通过 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

enter image description here

关于powershell - 如何查找 Azure PowerShell 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34157067/

相关文章:

powershell - 使用if条件在PowerShell中进行比较

powershell - 使用 powershell 列出订阅中的所有 Azure 服务

powershell - 使用 ScriptBlock 和 ArgumentList 调用时,Invoke-Command 仅返回单个对象

azure - Azure辅助角色 e :\approot folder disappearing on instance reboot 的内容

c# - Windows Azure 解决方案的最佳单元测试框架

node.js - 将内容安全策略添加到Azure Web APP

c++ - 如何用C++准确获取Windows操作系统版本?

sql - Powershell脚本创建xml文件

docker - 如何在 Ubuntu 18 上安装较旧的 Docker 版本(18.06.2)?

java - 适用于所有 Android 版本的通用 Android 对象样式?