2011-01-11 54 views

回答

7

使用CAST [string[]]

$sd = New-Object 'System.Collections.Generic.SortedDictionary[int, string[]]' 
$sd[0] = [string[]]("Data1a", "asda") 

另一個選項是將字典值類型更改爲object[]

$sd = New-Object 'System.Collections.Generic.SortedDictionary[int, object[]]' 
$sd[0] = "Data1a", "asda" 
+0

輝煌......我試圖鑄像你提到的,但我錯過了圓括號。謝謝 – nabeelfarid 2011-01-11 15:18:36