Normally, add assembly (GAC) to global assembly cache, and you can useGacUtil Tools. As long as the /i parameter is used, the assembly with the specified path can be added to the GAC.
However, since GacUtil is not part of the .Net Framework, but is released together with the Windows SDK, this leads to the fact that .Net is installed on the machine, but GacUtil may not be found.
In PowerShell, we can directly use the .Net class library to handle this without using GacUtil. The specific code is as follows:
[]::LoadWithPartialName("") > $null [] $publish = New-Object $("<Full Path to DLL>")
in addition,It also provides functions similar to RegAsm, and you can query MSDN for details.