使用PowerShell批量注册DLL到GAC

【转http://www.cnblogs.com/lambertqin/archive/2012/03/13/2393918.html

一段很小的代码,注册当前目录下所有的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 }

posted @ 2012-03-19 12:57  小师傅  阅读(217)  评论(0编辑  收藏  举报