5e29b02b24
* Update dependencies from https://github.com/dotnet/arcade build 20221108.2 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.CMake.Sdk From Version 6.0.0-beta.22512.3 -> To Version 6.0.0-beta.22558.2 * Update SourceBuild.Tasks.csproj tfm Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
38 lines
No EOL
1.2 KiB
PowerShell
38 lines
No EOL
1.2 KiB
PowerShell
|
|
function Install-Gdn {
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$Path,
|
|
|
|
# If omitted, install the latest version of Guardian, otherwise install that specific version.
|
|
[string]$Version
|
|
)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
Set-StrictMode -Version 2.0
|
|
$disableConfigureToolsetImport = $true
|
|
$global:LASTEXITCODE = 0
|
|
|
|
# `tools.ps1` checks $ci to perform some actions. Since the SDL
|
|
# scripts don't necessarily execute in the same agent that run the
|
|
# build.ps1/sh script this variable isn't automatically set.
|
|
$ci = $true
|
|
. $PSScriptRoot\..\tools.ps1
|
|
|
|
$argumentList = @("install", "Microsoft.Guardian.Cli", "-Source https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json", "-OutputDirectory $Path", "-NonInteractive", "-NoCache")
|
|
|
|
if ($Version) {
|
|
$argumentList += "-Version $Version"
|
|
}
|
|
|
|
Start-Process nuget -Verbose -ArgumentList $argumentList -NoNewWindow -Wait
|
|
|
|
$gdnCliPath = Get-ChildItem -Filter guardian.cmd -Recurse -Path $Path
|
|
|
|
if (!$gdnCliPath)
|
|
{
|
|
Write-PipelineTelemetryError -Category 'Sdl' -Message 'Failure installing Guardian'
|
|
}
|
|
|
|
return $gdnCliPath.FullName
|
|
} |