forked from kine/NVRAppDevOps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParse-ALCOutputToTFS.ps1
28 lines (27 loc) · 1.45 KB
/
Parse-ALCOutputToTFS.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function Convert-ALCOutputToTFS {
foreach ($_ in $input) {
switch -regex ($_) {
"^warning (\w{2}\d{4}):(.*('.*').*|.*)$" {
if (Test-Path $Matches[3]) {
Write-Host "##vso[task.logissue type=warning;sourcepath=$($Matches[3]);code=$($Matches[1]);]$($Matches[2])"
} else {
Write-Host "##vso[task.logissue type=warning;code=$($Matches[1]);]$($Matches[2])"
}
}
"^(.*)\((\d+),(\d+)\): error (\w{2}\d{4}): (.*)$"
#Objects\codeunit\Cod50130.NRMGetInfoCommand.al(62,30): error AL0118: The name '"Parent Object"' does not exist in the current context
{
Write-Host "##vso[task.logissue type=error;sourcepath=$($Matches[1]);linenumber=$($Matches[2]);columnnumber=$($Matches[3]);code=$($Matches[4]);]$($Matches[5])"
}
"^(.*)\((\d+),(\d+)\): warning (\w{2}\d{4}): (.*)$"
#Prepared for unified warning format
#Objects\codeunit\Cod50130.NRMGetInfoCommand.al(62,30): warning AL0118: The name '"Parent Object"' does not exist in the current context
{
Write-Host "##vso[task.logissue type=warning;sourcepath=$($Matches[1]);linenumber=$($Matches[2]);columnnumber=$($Matches[3]);code=$($Matches[4]);]$($Matches[5])"
}
default {
Write-Host $_
}
}
}
}