Register all dll in a directory in GAC Silently in powershell Register all dll in a directory in GAC Silently in powershell powershell powershell

Register all dll in a directory in GAC Silently in powershell


I am the author of PowerShell GAC. With PowerShell GAC you don't need gacutil and you can install all dlls in a folder to the GAC with the following command.

# Can only be run from an elevated promptAdd-GacAssembly C:\Folder\*.dll


Use gacutil.exe.

& gacutil.exe -i <strongly named DLL>

Note - the DLL must meet the requirements of being installable into the GAC.


The .Net Framework already contains methods to register components in the GAC. No need to add SDKs and third party plugins.

[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")$publisher = New-Object System.EnterpriseServices.Internal.Publish# For installation $publisher.GacInstall("C:\Components\MyComponent.dll")# For removal$publisher.GacRemove("C:\Components\MyComponent.dll")