zl程序教程

您现在的位置是:首页 >  其他

当前栏目

使用PowerShell批量注册DLL到GAC

批量注册 dll PowerShell 使用
2023-09-27 14:28:05 时间

一段很小的代码,注册当前目录下所有的DLL到GAC,请先把gacutil.exe复制到同一个目录。

$Path = Get-Location
$Dir = Get-ChildItem "$Path" -Recurse
$Dlls = $Dir | Where { $_.extension -eq ".dll" }
$Dlls | ForEach-Object { .\gacutil.exe -i $_.name }

原文:http://www.cnblogs.com/lambertqin/archive/2012/03/13/2393918.html