PowerShell中使用.NET将程序集加入全局程序集缓存(powershell怎么使用)一看就会

随心笔谈2年前发布 admin
186 0 0

文章摘要

文章讨论了使用Reflection.Assembly加载部分类集的方法,具体涉及LoadWithPartialName方法在加载System.EnterpriseServices类集及其相关DLL中的应用。文章介绍了如何通过创建和初始化System.EnterpriseServices.Internal.Publish对象,并使用GacInstall方法将DLL加载到系统中。这种技术在扩展系统功能和实现部分类集加载需求中具有重要意义。


[Reflection.Assembly]::LoadWithPartialName(“System.EnterpriseServices”) > $null
[System.EnterpriseServices.Internal.Publish] $publish=New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall(“<DLL的完整路径>”)

© 版权声明

相关文章