0

I am converting a powershell snapin(which was working really fine) to a powershell module.

I have added the output dll to a folder with the same name as the dll and added the Module path to the $env:PSModulePath

The import seems to fail because the Snapin had some references to some other dll's(located in the bin\ folder)

I also don't want to copy all referenced dll's into the modules folder because they are already in the bin folder.

Is there a way to indicate the folder in which the referenced dll's are located in powershell? Maybe to indicate the folder like it is done for individual dll's:

[reflection.assembly]::loadfrom(full name of referenced dll)

4

1 回答 1

0

我不知道有什么方法可以从另一个文件夹加载引用的 dll。如果您只想要目标文件夹中的一个 dll,您可以使用ILMerge可通过 NuGet 获得)将主输出程序集和引用的程序集合并到一个 dll 中。

于 2015-02-11T12:34:03.150 回答