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.