Powershell脚本

时间:2017-09-09 20:16:35

标签: powershell

我使用以下脚本导出CRM解决方案:

$crids=Get-Credential DOMAIN\GOPI
$conn=Get-CrmConnection -ServerUrl "http://XXXXXXXXXX/DeployPOC" -Credential 
Export-CrmSolution -conn $conn -SolutionName "Remove_Shipping_Address" -SolutionFilePath "C:\Users\Gopi\OneDrive\MYRD\DeploymentAutomation\CRM" -SolutionZipFileName MySolution.zip -TargetVersion 'gopi' 

但是我收到以下错误:

Export-CrmSolution : System.Management.Automation.MethodInvocationException: Exception calling "WriteAllBytes" with "2" argument(s): "Value cannot be null.
Parameter name: bytes" ---> System.ArgumentNullException: Value cannot be null.
Parameter name: bytes
at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
at CallSite.Target(Closure , CallSite , Type , Object , Object )
-- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
At line:16 char:1
+ Export-CrmSolution -conn $conn -SolutionName "Remove_Shipping_Addres ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Export-CrmSolution

我该如何解决?

0 个答案:

没有答案