我有一个由键/值对的哈希表组成的哈希表(来自 .ini 文件)。它看起来像这样:
Name Value
---- -----
global {}
Variables {event_log, software_repo}
Copy Files {files.mssql.source, files.utils.source, files.utils.destination, fil...
如何在一个哈希表中输出所有键/值对,而不是这样做?
$ini.global; $ini.variables; $ini."Copy Files"
最佳答案
鉴于 $hh
是哈希表的哈希表,您可以使用循环:
foreach ($key in $hh.keys)
{
Write-Host $hh[$key]
}
关于powershell - 如何在Powershell中输出多个哈希表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10935836/