- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Azure DevOps ci 管道上有一个内联 PowerShell 任务,需要忽略任何警告,但是,任何错误都会使任务失败并停止构建。
我最初将“标准错误失败”设置为 true,但由于所有错误和警告都写入 stderr,因此任何警告都会失败。
下面我尝试将“标准错误失败”设置为 false。尽管注意到错误并没有使任务失败。
sfdx partial:lsapp:build
if ($exitCode -ne 0)
{
Write-Output (\"[Error] Failing task since return code was {0} while expected 0.\" -f $exitCode)
}
[Environment]::Exit($exitCode)
任何帮助将不胜感激。
最佳答案
似乎 salesforce cli 向 stderr 写入警告。在这种情况下,您无法在执行 salesforce 命令的内联 PowerShell 任务中分离警告和错误。
但是,如果您想根据退出代码使管道失败,您仍然可以使用解决方法:将退出代码保存在管道变量中,并在具有 failOnStderr: true
的单独任务中对其进行评估> 如果需要的话会失败:
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
#sfdx partial:lsapp:build
$exitCode = 1 # Setting this for testing
Write-Host "##vso[task.setvariable variable=sfdxExitCode;]$exitCode"
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
$exitCode = $(sfdxExitCode)
if ($exitCode -ne 0)
{
Write-Error ("Failing task since return code was {0} while expected 0." -f $exitCode)
}
failOnStderr: true
关于powershell - Azure DevOps 因警告而失败,且 'fail on standard error' 设置为 true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68200774/
JavaScript Standard Style 翻译: Português, Spanish, 繁體中文, 简体中文 standard 规则列表,太多不必阅读。 了解 standard 的最好方式
我有一个 exec我使用 outputproperty 将其输出放入属性的任务属性。该命令可能会向 stderr 打印一些错误,我不希望将这些错误包含在输出中(因为输出被馈送到另一个命令中),而是要打
标题说明了一切 - 如何将 .NET 标准库标记为符合 CLS? 我用 C# 编写了一个简单的库,目标是 .NET Standard 1.0 框架。它包括两个枚举: public enum Align
我有一个写入错误输出的 PowerShell 脚本。该脚本可以简单如下: Write-Error 'foo' Start-Sleep -s 5 Write-Error 'bar' 我实际调用的脚本产生
对于完整的 .NET 项目,您可以在 Project Properties > Application tab > Assembly Information.. 中勾选一个框以使项目 COM 可见。
我将我的项目 ( https://github.com/MarkKhromov/The-Log) 迁移到 .NET Standard 2.0,但我的应用程序构建已损坏。我该如何解决这个问题? 我的解决
互联网上的许多文章都使用“标准输入/输出/错误流”术语好像每个术语都与使用的“标准输入/输出/错误设备”术语具有相同的含义在其他文章上。例如,很多文章说标准输出流默认是监视器,但可以重定向到文件、打印
我正在尝试从 https://github.com/go-yaml/yaml 导入 go-yaml ,并且我看到了 Google 未提供帮助的错误。 我运行了 go get gopkg.in/yaml
在列出 TimeZoneInfo.GetSystemTimeZones 返回的 TimeZoneInfo 的所有 Id 属性时,出现了两个版本的 EST:美国东部标准时间和东部标准时间。有什么区别?
问题: 如函数的 C 引用页所述,c16rtomb,来自 CPPReference ,在注释部分下: In C11 as published, unlike mbrtoc16, which conve
我想使用 go 语言从我的数据库中检索一些数据。这是我在文件 main.go 中的代码的开头 package main import ( _ "github.com/go-sql-driver
我一直在通过STM32F4发现进行音频项目,我注意到一件事,所有I2S标准仅适用于一个麦克风(取决于标准使用单独的位的哪个边缘)。例如飞利浦(Philips),MSB或LSB标准使用下降沿作为位触发,
有没有标准定义了 语法 和 语义的 汇编语言 ?与语言类似 C 有 ISO 标准和语言 C# 有 ECMA 标准?是只有一种标准,还是有更多标准? 我问是因为我noticed那个汇编语言代码看了不同
关闭。这个问题是opinion-based .它目前不接受答案。 想改进这个问题?更新问题,以便 editing this post 提供事实和引用来回答它. 1年前关闭。 Improve this
我们正在内部构建API,并且经常传递带有多个值的参数。 他们使用:mysite.com?id=1&id=2&id=3 代替:mysite.com?id=1,2,3 我赞成第二种方法,但我很好奇是否真的
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be
我认为有很多人不知道RFC(征求意见)。我知道它们在逻辑上是什么,但是有人能为新开发人员提供一个很好的描述吗?另外,共享一些有关如何使用和阅读它们的资源也很好。 最佳答案 这个术语来自互联网的前身AR
我找不到 Somaliland 的两个字母的国家/地区缩写,可能是因为它不是一个国家,而是正如维基百科所说:“一个未被承认的 self 宣布的事实上的主权国家,被国际承认为索马里的一个自治区”。尽管如
我正在编写一款蜜 jar 软件,该软件将对其交互进行大量记录,我计划记录纯文本 .log 文件。 我有两个问题,来自不太熟悉服务器日志方式的人。 首先,我该如何分解我的日志文件,我假设运行一个月后我不
我最近负责调试两个不同的程序,这两个程序最终至少需要共享一个 XML 解析脚本。一个是用 PureMVC 编写的,另一个是从头开始构建的。虽然最初从头开始编写是有意义的(它节省了大量内存,但内存问题已
我是一名优秀的程序员,十分优秀!