PowerShell で .NET フレームワークにプッシュしてきましたが、理解できない問題にぶつかりました。これはうまくいきます:
$foo = New-Object "System.Collections.Generic.Dictionary``2[System.String,System.String]"
$foo.Add("FOO", "BAR")
$foo
Key Value
--- -----
FOO BAR
ただし、これは次のことを行いません。
$bar = New-Object "System.Collections.Generic.SortedDictionary``2[System.String,System.String]"
New-Object : Cannot find type [System.Collections.Generic.SortedDictionary`2[System.String,System.String]]: make sure t
he assembly containing this type is loaded.
At line:1 char:18
+ $bar = New-Object <<<< "System.Collections.Generic.SortedDictionary``2[System.String,System.String]"
それらは両方とも同じアセンブリにあるので、何が欠けていますか?
回答で指摘されているように、これは PowerShell v1 のみの問題です。