msbuild

Форк
0
/
sdl.ps1 
39 строк · 1.3 Кб
1

2
function Install-Gdn {
3
    param(
4
        [Parameter(Mandatory=$true)]
5
        [string]$Path,
6

7
        [string]$Source = "https://pkgs.dev.azure.com/dnceng/_packaging/Guardian1ESPTUpstreamOrgFeed/nuget/v3/index.json",
8

9
        # If omitted, install the latest version of Guardian, otherwise install that specific version.
10
        [string]$Version
11
    )
12

13
    $ErrorActionPreference = 'Stop'
14
    Set-StrictMode -Version 2.0
15
    $disableConfigureToolsetImport = $true
16
    $global:LASTEXITCODE = 0
17

18
    # `tools.ps1` checks $ci to perform some actions. Since the SDL
19
    # scripts don't necessarily execute in the same agent that run the
20
    # build.ps1/sh script this variable isn't automatically set.
21
    $ci = $true
22
    . $PSScriptRoot\..\tools.ps1
23

24
    $argumentList = @("install", "Microsoft.Guardian.Cli.win-x64", "-Source $Source", "-OutputDirectory $Path", "-NonInteractive", "-NoCache")
25

26
    if ($Version) {
27
        $argumentList += "-Version $Version"
28
    }
29
    
30
    Start-Process nuget -Verbose -ArgumentList $argumentList -NoNewWindow -Wait
31

32
    $gdnCliPath = Get-ChildItem -Filter guardian.cmd -Recurse -Path $Path
33

34
    if (!$gdnCliPath)
35
    {
36
        Write-PipelineTelemetryError -Category 'Sdl' -Message 'Failure installing Guardian'
37
    }
38

39
    return $gdnCliPath.FullName
40
}

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.