如何在Azure PowerShell中获取所有资源参数详细信息

时间:2020-03-04 23:15:19

标签: azure powershell azure-powershell

亲爱的

我想知道如何获取特定资源的所有参数,“获取”命令无法获取所有详细信息!

例如,我需要获取此公共IP地址的IP

Get-AzResource -Name "PubIP"

Name              : PubIP
ResourceGroupName : RG1
ResourceType      : Microsoft.Network/publicIPAddresses
Location          : centralus
ResourceId        : /subscriptions/xxxxxx/Microsoft.Network/publicIPAddresses/PubIP

我尝试过

Get-AzResource -Name "PubIP" | Where-Object { $_.Scope -contains 'address' }

但是也没有用!

1 个答案:

答案 0 :(得分:1)

最好使用专用的powershell cmdlet来获取资源的详细信息。

例如,要获取公共IP地址的详细信息,可以使用Get-AzPublicIpAddress。测试结果:

enter image description here