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