title: Generic type of Generic Type in Powershell
body: <p>Well generics in Powershel are quite confusing. 
  To instantiate a simple List you need to dance around with a tambourine:</p>
  
  <pre><code>$type = ("System.Collections.Generic.List"+'`'+"1") -as "Type"
  $type= $type.MakeGenericType("System.string" -as "Type")
  $o = [Activator]::CreateInstance($type)
  </code></pre>
  
  <p>But what if I need something a bit more complex like: <code>&lt;Dictionary&lt;string,List&lt;Foo&gt;&gt;</code> for example</p>
  
  <p>or for example here: <code>Dictionary&lt;string,List&lt;string&gt;&gt;</code></p>
  
  <pre><code>$listType = ("System.Collections.Generic.List"+'`'+"1") -as "Type"
  $listType = $listType.MakeGenericType("System.string" -as "Type")
  $L = [Activator]::CreateInstance($listType)
  
  $dicType = ("System.Collections.Generic.Dictionary"+'`'+"2") -as "Type"
  
  #the next line is problematic
  $dicType = $dicType.MakeGenericType( 
       @( ("system.string" -as "Type"), 
          ("System.Collections.Generic.List" as "Type)) # and that's of course wrong
        )
  
  $D = [Activator]::CreateInstance($dicType )
  </code></pre>