# Using PowerShell to Install a DLL into the GAC

A couple of ways exist to install a DLL into the Global Assembly Cache (GAC). Using gacutil.exe is one, but this comes as part of a Visual Studio installation, and in a server environment, you may not have the luxury of installing Visual Studio, just to get the utility installed.

An alternative, however, is to use PowerShell to install the DLL into the GAC. The following code snippet should take care of your needs.

1#Note that you should be running PowerShell as an Administrator
3$publish = New-Object System.EnterpriseServices.Internal.Publish 4$publish.GacInstall("C:\Path\To\DLL.dll")
8#iisreset