PowerShell中是否有Add-Type
导入模块时?
我有一个作为模块导入的自定义 VB DLL。DLL 中有 2 个导入:
Imports Microsoft.ConfigurationManagement.ManagementProvider
Imports Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine
依赖于的功能在WqlQueryEngine
我这样做之前不起作用:
Add-Type "C:\Program Files (x86)\Configuration Manager\Console\bin\AdminUI.WqlQueryEngine.dll"
无论如何在导入期间这样做吗?或者更改 PowerShell 在哪里寻找程序集?
另外为什么我必须这样做?导入所依赖的文件都在同一个目录中?第一个导入依赖于C:\Program Files (x86)\Configuration Manager\Console\bin\Microsoft.ConfigurationManagement.ManagementProvider.dll
.
为什么一个工作而另一个需要添加?