Thursday, October 17, 2013

Move dll to Gac using powershell

Developers during debugging their code, move their dll to gac and reset IIS. To automate this and save time, we can create a powershell script.


[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish $publish.GacInstall("D:\Prasath\Workouts\Lookup\bin\Debug\SP.MyContent.dll")
iisreset

Save the above code as "somefilename.ps1"
To execute, right click the saved file and select "Run with Powershell"

No comments:

Post a Comment