如何创建嵌套词典



试图使用powershell中的对象创建嵌套字典,但显示错误,有什么方法可以像下面这样创建吗??

$Adress = New-Object "System.Collections.Generic.Dictionary[[String],[string,string]]

[string,string]本身不是有效的类型文字。如果内部值应该是字典,则需要将Dictionary[string,string]指定为第二种类型约束:

$nestedDict = [System.Collections.Generic.Dictionary[string,System.Collections.Generic.Dictionary[string,string]]]::new()

最新更新