File tree 2 files changed +17
-4
lines changed
2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,18 @@ param(
10
10
11
11
& " $CIToolsPath \tools\PoliCheck\PoliCheck5.8.1\PoliCheck.exe" / F:" $PSScriptRoot \..\artifacts" / T:" 9" / O:" $PSScriptRoot \..\artifacts\PoliCheck-Scan.xml"
12
12
13
- $poliCheckReport = Get-Content $PSScriptRoot \..\artifacts\PoliCheck- Scan.xml
14
- if ($poliCheckReport -like " *Severity=`" 1`" *" )
15
- {
16
- throw " PoliCheck failed with a Severity 1 issue, please check the report at in artifacts/PoliCheck-Scan.html"
13
+ [xml ]$poliCheckReport = Get-Content $PSScriptRoot \..\artifacts\PoliCheck- Scan.xml
14
+
15
+ $hits = $poliCheckReport.PLCKRR.Result.Object | Where-Object { $_.Severity -eq 1 }
16
+
17
+ $suppressions = Get-Content - Raw $PSScriptRoot / PolicheckSuppressions.json | ConvertFrom-Json
18
+
19
+ $hits | ForEach-Object {
20
+ $relativePath = ($_.URL -split " artifacts" )[1 ]
21
+ $fileName = " artifacts" + $relativePath
22
+ $TermId = $_.TermId
23
+ if ($suppressions .$fileName -ne $TermId )
24
+ {
25
+ throw " PoliCheck failed with a Severity 1 issue, please check the report at in artifacts/PoliCheck-Scan.html"
26
+ }
17
27
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "artifact\\ ExampleFile1.dll" : " TermId"
3
+ }
You can’t perform that action at this time.
0 commit comments