Select-Object Name Write-host "$...

问题描述 投票:0回答:1
According to

this

comment, your output is a hashtable which in turn means that

$files = Get-AzIntegrationAccountMap -ResourceGroupName "test-rg" -Name "testing-ia" | Select-Object Name

Write-Host "$files"

Will do you no good. In hash tables, you take input from the table with

or
azure powershell azure-powershell
1个回答
1
投票

Output:and the other way:Output (again):

Get-AzIntegrationAccountMap -ResourceGroupName "test-rg" -Name "testing-ia" | Select-Object Name

So try using

$var.value

$var["value"]

我无法将以下命令的值存储在一个变量中。

$test = @{name="test"}

例如,我不能将下面命令的值存储在一个变量中。

$test.name

注:如果我单独执行它,我得到的结果是: 它会给我16个文件。

test

$test["name"]

test

我无法将下面命令的值存储在一个变量中。例如: $files = Get-AzIntegrationAccountMap -ResourceGroupName "test-rg" -Name "testing-ia" 。

© www.soinside.com 2019 - 2024. All rights reserved.