Man*_*jSS 19 powershell cmdlets version azure azure-powershell
我需要通过cmdlet代码找到已安装的Azure PowerShell版本.如何找到Azure PowerShell版本?
注意:除了cmdlet代码之外,也欢迎使用.
juv*_*han 41
此PowerShell cmdlet将获取Azure PowerShell版本.
Get-Module -ListAvailable -Name Azure -Refresh
Run Code Online (Sandbox Code Playgroud)
它具有一个主要优点,即使Azure模块尚未加载到当前的PowerShell会话中,它也能够返回预期的结果.
相反,(Get-Module Azure).Version只会工作,如果Azure的模块已经被加载到当前PowerShell会话之前,即通过调用Azure的模块的任何cmdlet的当前PowerShell会话,如Get-AzureStorageAccount
Man*_*jSS 12
使用:
(Get-Module azure).Version
Run Code Online (Sandbox Code Playgroud)
这将返回已安装的Azure PowerShell的版本.
小智 10
Get-InstalledModule -Name Az -AllVersions | select Name,Version
Run Code Online (Sandbox Code Playgroud)
它记录在https://docs.microsoft.com/en-us/powershell/azure/install-az-ps 中。
小智 7
您还可以使用以下cmdlet获取Azure PowerShell版本!
复制并粘贴以下内容,然后运行它!
(Get-Module -ListAvailable | Where-Object{ $_.Name -eq 'Azure' }) ` | Select Version, Name, Author, PowerShellVersion | Format-List;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
31105 次 |
| 最近记录: |