Guest User

Untitled

a guest
Feb 16th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add-type -ReferencedAssemblies System.EnterpriseServices -typedefinition @'
  2.     using System;
  3.     using System.Globalization;
  4.     using System.EnterpriseServices.Internal;
  5.  
  6.     public class GacInstall    
  7.     {
  8.         public static void Main(string[] arguments)
  9.         {
  10.             try
  11.             {
  12.                 string assemblyPath = arguments[0];
  13.                 Publish publish = new Publish();
  14.                 publish.GacRemove(assemblyPath);
  15.                 publish.GacInstall(assemblyPath);
  16.                 Console.WriteLine("Done!");
  17.             }
  18.             catch (Exception e)
  19.             {
  20.                 Console.WriteLine(e);
  21.             }
  22.         }
  23.     }
  24. '@
  25. [GacInstall]::Main($args)
Advertisement
Add Comment
Please, Sign In to add comment