Created
January 14, 2016 04:39
-
-
Save blacktambourine/31d9c90558c561d4d12d to your computer and use it in GitHub Desktop.
Nuget Powershell to Set CopyLocal to false for dlls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param($installPath, $toolsPath, $package, $project) | |
$asms = $package.AssemblyReferences | %{$_.Name} | |
$configName = $project.ConfigurationManager.ActiveConfiguration.ConfigurationName | |
Write-Host "Updating dlls for configuration - ${configName}"; | |
if ($configName -NotLike "*CD") | |
{ | |
Write-Host "Updating dlls for Non-CD (Content Delivery) Environment"; | |
foreach ($reference in $project.Object.References) | |
{ | |
if ($asms -contains $reference.Name + ".dll") | |
{ | |
$currentDLLName = $reference.Name + ".dll"; | |
$reference.CopyLocal = $false; | |
Write-Host "CopyLocal set to false - ${currentDLLName}"; | |
} | |
} | |
} | |
Write-Host "DLL Install and config complete."; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment