导出 - crmsolution循环失败? (Microsoft.xrm.data.powershell)
我正在尝试导出所有功率自动化解决方案。导出crmsolution一次工作一个,但是当我试图使其通过解决方案名称循环时会破裂。我尝试将它们放入数组中,将变量放入引号和括号中,并确保将其格式化为字符串。 该模块完全是新的,因此任何帮助都非常感谢!
$allSolutions = (Get-CrmRecords -EntityLogicalName solution -Fields *)
foreach($solution in $allSolutions)
{
$solutionname = $Solution.CrmRecords.friendlyname | Out-String
Export-CrmSolution -SolutionName $solutionname
}
错误:
Get-CrmRecordsByFetch : System.Management.Automation.RuntimeException: ************ FaultException`1 - RetrieveMultiple : GetEntityDataByFetchSearch |=> Sql error: A validation error occurred. A string value provided is too long. CRM ErrorCode: -2147012607 Sql ErrorCode: -2146232060 Sql Number: 8152
I'm trying to export all Power Automate solutions. Export-CrmSolution works one at a time, but breaks when I try to make it loop through the solution names. I've tried putting them into an array, putting the variable in quotes and parentheses, and making sure it is formatted as a string.
Totally new to this module, so any help greatly appreciated!
$allSolutions = (Get-CrmRecords -EntityLogicalName solution -Fields *)
foreach($solution in $allSolutions)
{
$solutionname = $Solution.CrmRecords.friendlyname | Out-String
Export-CrmSolution -SolutionName $solutionname
}
Error:
Get-CrmRecordsByFetch : System.Management.Automation.RuntimeException: ************ FaultException`1 - RetrieveMultiple : GetEntityDataByFetchSearch |=> Sql error: A validation error occurred. A string value provided is too long. CRM ErrorCode: -2147012607 Sql ErrorCode: -2146232060 Sql Number: 8152
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有趣的事实:解决了。谢谢!
字符串太长?
过滤到仅可见解决方案。
例如。
where -object {$ _。iSvisible -eq“ yes”}
它想要该唱片的独特名称,而不是友好名称。
例如。
earter-crmsolution“ $($ solution.uniquename)”
繁荣,它起作用。
Fun Fact: Solved it. Thanks!
String Too Long?
Filter to only visible solutions.
Ex.
Where-Object{ $_.isvisible -eq "yes"}
Can't find solution by "Name"?
It wants the record's UniqueName, not FriendlyName.
Ex.
Export-CrmSolution "$($solution.uniquename)"
Boom, it works.