许多人在使用 OneDrive 帐户登录 Power Automate 时遇到“访问被拒绝”错误。这可能会完全阻止登录,或者您可能能够登录但流程无法运行。

调查此问题后,似乎存在 OneDrive 服务器拒绝某些帐户访问 Power Automate 的问题(例如,我的 Outlook 帐户运行正常)。

如果您需要在等待客户支持时让流程正常运行,可以采用以下解决方法:

  1. 转到本地文件并获取原始数据:C:\Users[USERNAME]\AppData\Local\Microsoft\Power Automate Desktop\Console\Workspace。每个文件夹都是您在此文件夹中的每个流存储本地。现在进入第 2 级,您会看到类似这样的内容。

    ,因此您需要在此处打开 3 个文件。controlRepo.appmask – 是您的 UI 元素,imageRepo.imgrepo – 是您保存的屏幕截图,script.robin 本身是实际的代码流。

  2. 可能存在更简化的解决方案,但目前,我的解决方法是一次将一个文件传输到新流程中。我的建议是从 imageRepo.imgrepo > controlRepo.appmask > script.robin 导入流程

  • 首先创建一个流程来从 imageRepo.imgrepo 和 controlRepo.appmask 准备复制字符串

将此代码复制到您的流程中(基本按 ctrl+C 然后按 ctrl+V 到流程)

Clipboard.GetText Text=> ClipboardText
Text.Replace Text: ClipboardText TextToFind: $'''\\''' IsRegEx: False IgnoreCase: False ReplaceWith: $'''\\\\''' ActivateEscapeSequences: False Result=> ClipboardText
Text.Replace Text: ClipboardText TextToFind: $'''\"''' IsRegEx: False IgnoreCase: False ReplaceWith: $'''\\\"''' ActivateEscapeSequences: False Result=> ClipboardText
Text.SplitText.Split Text: ClipboardText StandardDelimiter: Text.StandardDelimiter.NewLine DelimiterTimes: 1 Result=> TextList
Text.JoinText.JoinWithCustomDelimiter List: TextList CustomDelimiter: $'''\\r\\n''' Result=> JoinedText

现在用记事本打开 imageRepo.imgrepo 如下图所示,然后按 Ctrl+A 和 Ctrl+C 然后运行流程。这里会将剪贴板转换为一个字符串。现在执行“Joinedtext”并将其复制出来并粘贴到下面的模板中。现在对 controlRepo.appmask 执行相同操作

  • 现在您需要将模板放入剪贴板中。这是我的模板:
Display.ShowMessageDialog.ShowMessage Title: $'''test''' Message: $'''test''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed

# [ControlRepository][PowerAutomateDesktop]

{
  "ControlRepositorySymbols": [
    {
      "IgnoreImagesOnSerialization": false,
      "Repository": "[PASTE your controlRepo.appmask HERE]",
      "ImportMetadata": {
        "DisplayName": "Local computer",
        "ConnectionString": "",
        "Type": "Local",
        "DesktopType": "local"
      },
      "Name": "appmask"
    }
  ],
  "ImageRepositorySymbol": {
    "Repository": "[PASTE your imageRepo.imgrepo HERE]",
    "ImportMetadata": {},
    "Name": "imgrepo"
  },
  "ConnectionReferences": []
}

当您完成后,您可以选择所有 ctrl+C,然后转到电源自动化创建新流程并按 cotrl+V。现在您将在右侧面板中获得一些 UI 元素和图像。在这里您可以从主流程中删除显示消息。

  1. 将代码放入主流和子流。现在转到 Script.robin。如果您没有子流。然后复制(CTRL + C)“@SENSITIVE:[]”下的所有内容,如果您有子流,则在“FUNCTION [YOUR SUB FLOW NAME] GLOBAL”之前停止,现在返回到电源自动化中的主流 CTRL + V 您将再次看到出现。

如果您有子流,创建与旧名称完全相同的名称,然后再次转到 Script.robin。查找“FUNCTION [YOUR SUB FLOW NAME] GLOBAL”和“END FUNCTION”之间的代码 Ctrl+C,然后返回到电源自动化。在相同的子流名称中按 Ctrl+V。对每个子流执行相同的操作。

$(function() {
$(“.js-gps-inline-related-questions .spacer”).on(“click”, function () {
fireRelatedEvent($(this).index() + 1, $(this).data(‘question-id’));
});

function fireRelatedEvent(position, questionId) {
StackExchange.using(“gps”, function() {
StackExchange.gps.track(‘related_questions.click’,
{
position: position,
originQuestionId: 79083333,
relatedQuestionId: +questionId,
location: ‘inline’,
source: ‘Baseline_Fallback’
});
});
}
});

function toggleInlineRelated(showMore) {
var inlineRelatedLess = document.getElementById(“inline_related_var_a_less”);
var inlineRelatedMore = document.getElementById(“inline_related_var_a_more”);

var inlineRelatedSeeMore = document.getElementById(“inline_related_see_more”);
var inlineRelatedSeeLess = document.getElementById(“inline_related_see_less”);

if (showMore) {
inlineRelatedLess.classList.add(“d-none”);
inlineRelatedSeeMore.classList.add(“d-none”);

inlineRelatedMore.classList.remove(“d-none”);
inlineRelatedSeeLess.classList.remove(“d-none”);
}
else {
inlineRelatedMore.classList.add(“d-none”);
inlineRelatedSeeLess.classList.add(“d-none”);

inlineRelatedLess.classList.remove(“d-none”);
inlineRelatedSeeMore.classList.remove(“d-none”);
}
}

0