Can PowerShell use a local assembly with a different version in the GAC?
<p>I need to reference <code>System.Net.Http.dll</code> version 2.2.29.0 in a PowerShell script. The GAC has <code>System.Net.Http</code> version 4.0.0.0. Is it possible to redirect to my local DLL without modifying the GAC?</p>

<p>I've tried:</p>

<ol>
<li>Adding the DLL through <code>Add-Type -Path 'System.Net.Http.dll'</code>.</li>
<li>Creating a .config file with an <code>&lt;assemblyBinding&gt;</code> element, like what .NET applications use for binding redirects.</li>
<li>Loading the DLL through <code>[Reflection.Assembly]::LoadFrom("$PSScriptRoot\System.Net.Http.dll")</code>.</li>
</ol>

<p>In all cases, subsequently executing <code>[AppDomain]::CurrentDomain.GetAssemblies()</code> shows that version 4.0.0.0 in <code>C:\Windows</code> is still the only copy loaded.</p>