Advertisement
private775

Copy To GAC (VS External Tools)

Jan 9th, 2015
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set-Alias GACUTIL "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe" -Force
  2.  
  3. ############# Copy to GAC ##################################
  4.  
  5. function CopyToGac([string]$dllPath){
  6.     $asName = [System.Reflection.AssemblyName]::GetAssemblyName($dllPath).FullName
  7.     Write-Host "Removing $($asName) from GAC"
  8.     GACUTIL /u $asName
  9.     Write-Host "Adding $($dllPath) to GAC"
  10.     GACUTIL /i $dllPath
  11.     iisreset /noforce
  12.  
  13. }
  14. # PW Path: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  15. # COMMAND: -NoLogo -NonInteractive -ExecutionPolicy Unrestricted -Command "& { CopyToGac '$(TargetPath)' } "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement