Azure 如何在变量中存储Get AzIntegrationAccountMap的值
我无法将LOWER命令的值存储在变量中 例如:Azure 如何在变量中存储Get AzIntegrationAccountMap的值,azure,powershell,azure-powershell,Azure,Powershell,Azure Powershell,我无法将LOWER命令的值存储在变量中 例如: $files = Get-AzIntegrationAccountMap -ResourceGroupName "test-rg" -Name "testing-ia" | Select-Object Name Write-Host "$files" 注意:如果我单独执行它,就会得到结果。它将给我16个文件。根据评论,您的输出是一个哈希表,这反过来意味着 Get-AzIntegrationAccountMap -ResourceGroupNam
$files = Get-AzIntegrationAccountMap -ResourceGroupName "test-rg" -Name "testing-ia" | Select-Object Name
Write-Host "$files"
注意:如果我单独执行它,就会得到结果。它将给我16个文件。根据评论,您的输出是一个哈希表,这反过来意味着
Get-AzIntegrationAccountMap -ResourceGroupName "test-rg" -Name "testing-ia" | Select-Object Name
对你没有好处。在哈希表中,使用
$var.value
或
例如,如果我制作一个哈希表
$test = @{name="test"}
我可以像这样从中获取信息
$test.name
输出:
test
另一方面:
$test["name"]
再次输出:
test
所以试着使用
$files = $(Get-AzIntegrationAccountMap -ResourceGroupName "test-rg" -Name "testing-ia").name
write-host "$files"
只需使用$files并查看输出是否存在。它不起作用这意味着变量定义有错误,但我正在从GET命令获得结果。知道如何解决它吗?Try$files=$GET-AzIntegrationAccountMap-ResourceGroupName test rg-Name testing ia |选择对象名称您的欢迎,乐意帮助:。若这回答了你们的问题,请点击我答案左上角的绿色复选标记接受它
$files = $(Get-AzIntegrationAccountMap -ResourceGroupName "test-rg" -Name "testing-ia").name
write-host "$files"