2
[string] $GuardianCliLocation,
3
[string] $WorkingDirectory,
5
[string] $UpdateBaseline,
6
[string] $GuardianLoggerLevel='Standard'
9
$ErrorActionPreference = 'Stop'
10
Set-StrictMode -Version 2.0
11
$disableConfigureToolsetImport = $true
12
$global:LASTEXITCODE = 0
15
# `tools.ps1` checks $ci to perform some actions. Since the SDL
16
# scripts don't necessarily execute in the same agent that run the
17
# build.ps1/sh script this variable isn't automatically set.
19
. $PSScriptRoot\..\tools.ps1
21
# We store config files in the r directory of .gdn
22
$gdnConfigPath = Join-Path $GdnFolder 'r'
23
$ValidPath = Test-Path $GuardianCliLocation
25
if ($ValidPath -eq $False)
27
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location."
31
$gdnConfigFiles = Get-ChildItem $gdnConfigPath -Recurse -Include '*.gdnconfig'
32
Write-Host "Discovered Guardian config files:"
33
$gdnConfigFiles | Out-String | Write-Host
36
& $GuardianCliLocation run `
37
--working-directory $WorkingDirectory `
38
--baseline mainbaseline `
39
--update-baseline $UpdateBaseline `
40
--logger-level $GuardianLoggerLevel `
41
--config @gdnConfigFiles
46
Write-Host $_.ScriptStackTrace
47
Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_