Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.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
使用Get-AzLocation选择特定Azure位置_Azure_Powershell - Fatal编程技术网

使用Get-AzLocation选择特定Azure位置

使用Get-AzLocation选择特定Azure位置,azure,powershell,Azure,Powershell,我正试图找到一种使用Azure PowerShell选择目标Azure位置(对象)的方法 这给了我一个位置列表: Get-AzLocation | select DisplayName, Location | Format-Table 我如何选择其中的一个,比如 $Location = Get-AzLocation -Something "South Central US" 您可以使用在DisplayName上进行筛选: ❯ Get-AzLocation | Where-

我正试图找到一种使用Azure PowerShell选择目标Azure位置(对象)的方法

这给了我一个位置列表:

Get-AzLocation | select DisplayName, Location | Format-Table
我如何选择其中的一个,比如

$Location = Get-AzLocation -Something "South Central US"
您可以使用在
DisplayName
上进行筛选:

❯ Get-AzLocation | Where-Object {$_.DisplayName -eq "South Central US"}

Location    : southcentralus
DisplayName : South Central US
Providers   : {Microsoft.Automation, Microsoft.Storage, Microsoft.Network, Microsoft.Compute…}

这将返回一个类型为的对象。

已确认,有效。谢谢你。