Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何显示表powershell中的可用位置_Powershell_Azure_Powershell 4.0_Azure Resource Manager_Azure Powershell - Fatal编程技术网

如何显示表powershell中的可用位置

如何显示表powershell中的可用位置,powershell,azure,powershell-4.0,azure-resource-manager,azure-powershell,Powershell,Azure,Powershell 4.0,Azure Resource Manager,Azure Powershell,您好,我使用PowerShell命令获取AzureRmLocation列出azure中的可用位置。我希望以表格或某种格式良好的方式整齐地显示它们,而不是逐行列出它们 我试过了 $locations = @(Get-AzureRmLocation | Select-Object -ExpandProperty DisplayName) Write-Host -ForegroundColor Yellow "Available Locations :" $locations | Format-Ta

您好,我使用PowerShell命令
获取AzureRmLocation
列出azure中的可用位置。我希望以表格或某种格式良好的方式整齐地显示它们,而不是逐行列出它们

我试过了

$locations = @(Get-AzureRmLocation | Select-Object -ExpandProperty DisplayName)
Write-Host -ForegroundColor Yellow "Available Locations :" 
$locations | Format-Table
但这也列出了所有让屏幕看起来很长而且不太好的东西。有办法吗

我得到的输出是这样一个列表

我希望它是一个包含所有可用位置的两个表列。 谢谢。

这就是你想要的吗

$locations = Get-AzureRmLocation
$locations | Format-Table @{n="Available Locations";e={$_.DisplayName}}
这是你想要的吗

$locations = Get-AzureRmLocation
$locations | Format-Table @{n="Available Locations";e={$_.DisplayName}}

也许您可以尝试以下示例:

$locations = Get-AzureRmLocation

$locations | Format-Table -Property Location,DisplayName
我在实验室进行测试,结果如下:

也许您可以尝试以下示例:

$locations = Get-AzureRmLocation

$locations | Format-Table -Property Location,DisplayName
我在实验室进行测试,结果如下:

要列出所有Azure位置,我建议使用

结果:

PowerShell版本:

要列出所有Azure位置,我建议使用

结果:

PowerShell版本:

不,兄弟,它仍然显示为项目列表。我可以要一张双面桌子吗?这应该是一张单列桌子。我没有访问Azure的权限,因此您需要使用从中获得的输出以及输出的示例来更新您的问题。记住替换敏感信息Nope brother,它仍然显示为项目列表。我可以要一张双面桌子吗?这应该是一张单列桌子。我没有访问Azure的权限,因此您需要使用从中获得的输出以及输出的示例来更新您的问题。记得更换敏感信息谢谢,谢谢你的帮助。这不是我想要的。但是它看起来比我现在的好谢谢你的帮助。这不是我想要的。但它看起来比我现在拥有的要好