0
我想在我的dotnet構建命令失敗時自定義腳本。 如何獲取錯誤列表或不成功的標誌,當'dotnet構建'失敗,例如編譯錯誤,或者'dotnet測試'失敗時,使用powershell。如何知道是否從PowerShell dotnet構建命令錯誤
我想等效代碼
dotnet test
if (!$result.Successful) {
$errorMessage = ""
if ($result.Error -ne $null) {
$errorMessage = $result.Error.Message
}
Write-Host "##vso[task.logissue type=error;] error"
Write-Host "##vso[task.complete result=Failed;]"
Exit -1
}