导出 - crmsolution循环失败? (Microsoft.xrm.data.powershell)

发布于 2025-02-01 03:45:51 字数 746 浏览 4 评论 0原文

我正在尝试导出所有功率自动化解决方案。导出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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疯到世界奔溃 2025-02-08 03:45:51

有趣的事实:解决了。谢谢!

  1. 字符串太长?
    过滤到仅可见解决方案。
    例如。

    where -object {$ _。iSvisible -eq“ yes”}

  2. 。。
    它想要该唱片的独特名称,而不是友好名称。
    例如。

    earter-crmsolution“ $($ solution.uniquename)”

繁荣,它起作用。

Fun Fact: Solved it. Thanks!

  1. String Too Long?
    Filter to only visible solutions.
    Ex.

    Where-Object{ $_.isvisible -eq "yes"}

  2. Can't find solution by "Name"?
    It wants the record's UniqueName, not FriendlyName.
    Ex.

    Export-CrmSolution "$($solution.uniquename)"

Boom, it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文