powershell是否具有关联数组? [英] Does powershell have associative arrays?
本文介绍了powershell是否具有关联数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一个返回ID,名称对的函数.
I am writing a function that returns an id, name pair.
我想做类似的事情
$a = get-name-id-pair()
$a.Id
$a.Name
like可能在javascript中出现.或至少
like is possible in javascript. Or at least
$a = get-name-id-pair()
$a["id"]
$a["name"]
like在php中是可能的.我可以使用powershell做到吗?
like is possible in php. Can I do that with powershell?
推荐答案
也
$a = @{'foo'='bar'}
或
$a = @{}
$a.foo = 'bar'
这篇关于powershell是否具有关联数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文