title: Generic from other assembly
body: <p>I was trying to create WCF client following instructions from here:
  <a href="https://stackoverflow.com/questions/2002954/execute-a-one-way-wcf-service-operation-from-powershell">Execute a one-way wcf service operation from powershell</a></p>
  
  <p>Here's the piece of code that is breaking</p>
  
  <pre><code>$contractDescription = [System.ServiceModel.Description.ContractDescription]::GetContract([Iinterface])
  $serviceEndpoint = New-Object System.ServiceModel.Description.ServiceEndpoint $contractDescription
  $channelFactory = New-Object "System.ServiceModel.ChannelFactory``1[Iinterface]" $serviceEndpoint
  </code></pre>
  
  <p>My interface is stored in a separate assembly that I have Add-Typed. What is puzzling me is that this </p>
  
  <pre><code>    $contractDescription = [System.ServiceModel.Description.ContractDescription]::GetContract([Iinterface])
  </code></pre>
  
  <p>is working just fine, but </p>
  
  <pre><code>    $channelFactory = New-Object "System.ServiceModel.ChannelFactory``1[Iinterface]" $serviceEndpoint
  </code></pre>
  
  <p>is failing with:</p>
  
  <blockquote>
    <p>New-Object : Cannot find type [System.ServiceModel.ChannelFactory`1[Iinterface]]: make sure the assembly containing this type is loaded.
    At C:\Users\amarchuk\AppData\Local\Temp\1\bbc2b1ab-fe3a-4982-a561-2bfe926b7362.ps1:29 char:29
    + $channelFactory = New-Object &lt;&lt;&lt;&lt;  "System.ServiceModel.ChannelFactory``1[Iinterface]" $serviceEndpoint
        + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
        + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand</p>
  </blockquote>
  
  <p>Did I mess up syntax around generics?
  Thanks.</p>