Azure PowerShell Runbook - 错误输出详细信息列为空

标签 azure azure-automation azure-runbook

我的自动化帐户中有一个 Azure PowerShell 7.1 Runbook,它正在按预期执行。我遇到的唯一问题是运行作业屏幕中的错误输出始终缺少详细信息列。这意味着我必须点击每条记录才能查看其中的内容,这非常繁琐。

注意:我使用 Write-Error 命令在 try/catch 内生成这些消息

你可以从下图中明白我的意思: enter image description here

任何帮助将不胜感激。

最佳答案

只有图形 PowerShell Runbook 类型允许您查看详细信息 列。尝试解决方法后,我找到了使用图形 PowerShell Runbook 的解决方案。

我创建了一个图形化 PowerShell Runbook 并将我的 PowerShell 添加到 Canvas 上。它已成功执行,并显示以下带有作业详细信息的输出:

除了 Runbook 消息之外,您还可以添加输入和输出,如下图所示。

我刚刚执行了一个示例 write-error 命令

写入错误“Hi”

自动化帐户 -> Runbook(类型:图形 Powershell Runbook):

enter image description here

enter image description here

输出:

enter image description here

关于Azure PowerShell Runbook - 错误输出详细信息列为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75463055/

相关文章:

python - 在 Azure Notebook VM 中找不到名为 'azure.datalake' 或 pip 的模块

c# - CRON 表达式在每月的最后一天触发 Azure 函数

azure - Azure Stack 上的 Runbook 部署

python-2.7 - Azure 自动化 : Parse WEBHOOKDATA with a python runbook

Azure PowerShell Runbook 不支持 System.Data.OleDb.OleDbConnection

azure - Powershell Runbook [Invoke-ASCmd],xmla 文件的 FileNotFoundException

Azure b2c 配置文件编辑策略自定义 UI

powershell - 尝试从 Azure Runbook 调用 Invoke-RestMethod 时无法连接到远程服务器

.net - Azure SubscriptionClient.PeekBatch