【发布时间】:2018-04-05 15:18:29
【问题描述】:
尝试执行时-
Import-Module 'C:\\Program Files\\Nimble Storage\\bin\\Nimble.Powershell.dll'
通过程序,我收到以下错误:
无法加载文件或程序集 'file:///C:\Program Files\Nimble Storage\bin\Nimble.Powershell.dll' 或其依赖项之一。一个 试图加载格式不正确的程序。
直接从 Powershell 运行时同样有效,但在上述情况下,面临问题。
使用过的C#程序和使用过的语句:
Collection< PSObject > resultCollection = runspaceInvoke.Invoke("Import-Module 'C:\\Program Files\\Nimble Storage\\bin\\Nimble.Powershell.dll'", null, out errors);
【问题讨论】:
-
模块是 x86 并且您使用的是 x64 PowerShell 是我的猜测,反之亦然
-
另外,“通过程序”是什么意思?什么节目?怎么样?
-
@EBGreen- 我的意思是 C# 程序。在那里,使用了语句: Collection
resultCollection = runspaceInvoke.Invoke("Import-Module 'C:\\Program Files\\Nimble Storage\\bin\\Nimble.Powershell.dll'", null, out errors) ; -
请编辑您的问题以显示您正在使用的代码。
标签: powershell dll import-module