Skip to content

Instantly share code, notes, and snippets.

@MikeLarned
Created January 5, 2012 21:36
Show Gist options
  • Save MikeLarned/1567454 to your computer and use it in GitHub Desktop.
Save MikeLarned/1567454 to your computer and use it in GitHub Desktop.
Powershell GacUtil - Updating GAC Assemblies with PS
$gacUtil = "${Env:ProgramFiles(x86)}\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe";
function Add-GacItem([string]$path) {
#Full Path Name or Relative - ex: C:\Temp\Larned.dll
& $gacutil "/nologo" "/i" "$path"
}
function Remove-GacItem([string]$name) {
#Assembly Name - ex: if Dll was Larned.dll then Larned
& $gacutil "/nologo" "/u" "$name"
}
function Search-GacItem([string]$name) {
#Assembly Name - ex: if Dll was Larned.dll then Larned
& $gacutil "/nologo" "/l" "$name"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment