Azure功能PowerShell哈希密钥

时间:2018-04-30 14:41:58

标签: powershell azure azure-functions

尝试通过API公开一些内部azure细节我发现我无法从Powershell Azure函数中的ResourceGroup对象中选择特定标记。

此代码段在标准PowerShell中有效,但在函数中不产生任何输出。

$rgs = Get-AzureRmResourceGroup

$output = @()

foreach($rg in $rgs) {
    $output += $rg.Tags.owner
}

Out-File -Encoding Ascii -FilePath $res -inputObject ($output | ConvertTo-Json)

如果我只选择标签(没有特定的键),我可以在那里看到所有信息,但是Tags.ownerTags['owner']没有输出。如果我做  Tags.Item('owner')我也有例外! 无法使用值转换参数" index"," owner",for" get_Item"输入" System.Int32"

如何在PowerShell Azure功能中使用哈希表?

0 个答案:

没有答案