Skip to content

Instantly share code, notes, and snippets.

@altrive
Created March 17, 2014 12:45
Show Gist options
  • Save altrive/9598588 to your computer and use it in GitHub Desktop.
Save altrive/9598588 to your computer and use it in GitHub Desktop.
#Load NuGet.Core.dll assembly(Load dll as byte stream to avoid dll locking issue)
$loadedDll = [AppDomain]::CurrentDomain.GetAssemblies() | where { $_.FullName.StartsWith("NuGet.Core")}
if($null -eq $loadedDll)
{
$dllPath = Join-Path $PSScriptRoot "NuGet.Core.dll" -Resolve
$dllBytes = [IO.File]::ReadAllBytes($dllPath)
[System.Reflection.Assembly]::Load($dllBytes) > $null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment