我想创建一个需要哈希表的函数。
我如何才能做到这一点?
function ([string]foo, [#what to write here]myHAshTable)发布于 2012-12-07 15:11:09
这?
function ([string]$foo, [hashtable]$myHAshTable)发布于 2012-12-07 15:13:11
我不认为你需要指定类型(即哈希表--只要你在你的函数中正确地引用了哈希表,你就可以传递变量。例如,传递哈希表参数$hash:
foreach ($key in $hash.Keys){
Write-Host $hash[$key]
}https://stackoverflow.com/questions/13758333
复制相似问题