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.

Revisions

  1. MikeLarned created this gist Jan 5, 2012.
    19 changes: 19 additions & 0 deletions GacUtil.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    $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"
    }