Reputation: 1
Trying to create nested dictionary using object in powershell but showing error, so is there any way to create like below??
$Adress = New-Object "System.Collections.Generic.Dictionary[[String],[string,string]]
Upvotes: 0
Views: 389
Reputation: 174690
[string,string]
is not in itself a valid type literal. If the inner values should be dictionaries you need to specify Dictionary[string,string]
as the second type constraint:
$nestedDict = [System.Collections.Generic.Dictionary[string,System.Collections.Generic.Dictionary[string,string]]]::new()
Upvotes: 2