programing

Azure PowerShell 버전을 찾으려면 어떻게 해야 합니까?

elecom 2023. 5. 8. 21:53
반응형

Azure PowerShell 버전을 찾으려면 어떻게 해야 합니까?

cmdlets 코드를 통해 설치된 Azure PowerShell 버전을 찾아야 합니다.Azure PowerShell 버전을 찾으려면 어떻게 해야 합니까?

참고: cmdlet 이외의 코드도 환영합니다.

이 PowerShell cmdlet은 Azure PowerShell 버전을 가져옵니다.

Get-Module -ListAvailable -Name Azure -Refresh

Azure 모듈이 현재 PowerShell 세션에 로드되지 않았더라도 기대한 결과를 반환할 수 있다는 큰 장점이 있습니다.

반대로,(Get-Module Azure).VersionAzure 모듈이 이전에 현재 PowerShell 세션에 로드된 적이 있는 경우, 즉 현재 PowerShell 세션의 Azure 모듈에서 cmdlet을 호출하는 경우에만 작동합니다.Get-AzureStorageAccount

여기에 이미지 설명 입력

사용:

(Get-Module azure).Version

설치된 Azure PowerShell 버전이 반환됩니다.

Azure PowerShell 버전

Get-InstalledModule -Name Az -AllVersions | select Name,Version

https://learn.microsoft.com/en-us/powershell/azure/install-az-ps 에 문서화되어 있습니다.

다음 cmdlet을 사용하여 Azure PowerShell 버전도 가져올 수 있습니다!

다음을 복사하여 붙여넣고 실행합니다!

(Get-Module -ListAvailable | Where-Object{ $_.Name -eq 'Azure' }) ` | Select Version, Name, Author, PowerShellVersion  | Format-List;
Get-Module AzureRM -List | Select-Object Name, Version, Path

여러 버전이 실행 중인 경우 실행하기 좋습니다.

공식 사용:
$PSVersionTable.PS 버전

버전 0.8 및 0.9에서는 ARM 모드가 아닌 Azure Service Management 모드로 실행됩니다.버전 1.0 이상에서는 원활하게 작동합니다.

 $name='Azure' 

    if(Get-Module -ListAvailable |  Where-Object { $_.name -eq $name })  
    {  
      (Get-Module -ListAvailable | Where-Object{ $_.Name -eq $name }) |  Select Version, Name, Author, PowerShellVersion  | Format-List;  
    }  
    else  
    {  
        “The Azure PowerShell module is not installed.” 
    }

여기에 이미지 설명 입력

건배!

PowerShell에서 다음 명령을 실행하면 현재 Azure PowerShell 버전이 표시됩니다.

Get-Module -ListAvailable -Name Az

언급URL : https://stackoverflow.com/questions/34157067/how-do-i-find-the-azure-powershell-version

반응형