1
我正在尝试编写PowerShell,并失败悲惨。导入模块 - 大会错误
Set-ExecutionPolicy Unrestricted
Import-Module -Assembly PowerShellXrm.Framework.CI.PowerShell.dll
和
Set-ExecutionPolicy Unrestricted
Import-Module -Assembly "PowerShellXrm.Framework.CI.PowerShell.dll"
,并得到下面的错误。
Import-Module : Cannot bind parameter 'Assembly'. Cannot convert the
"PowerShellXrm.Framework.CI.PowerShell.dll" value of type "System.String"
to type "System.Reflection.Assembly".
At line:1 char:25
+ Import-Module -Assembly PowerShellXrm.Framework.CI.PowerShell.dll
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Import-Module], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.ImportModuleCommand
PowerShell脚本保存在与PowerShellXrm.Framework.CI.PowerShell.dll
程序集相同的位置。我也试过包括没有运气的组装路径。
'-Assembly'参数想'Assembly'对象不路径。 – PetSerAl
[使用PowerShell运行我的第三方DLL文件]可能的重复(http://stackoverflow.com/questions/7972141/run-my-third-party-dll-file-with-powershell) – vonPryz