在 Azure DevOps 上创建新管道以设置 .NET 项目的 CI 时,我设置了以下 PowerShell 脚本来自动化 .NET Core 设置。
这是脚本:
$ErrorActionPreference="Stop"
$ProgressPreference="SilentlyContinue"
# $LocalDotnet is the path to the locally-installed SDK to ensure the
# correct version of the tools are executed.
$LocalDotnet=""
# $InstallDir and $CliVersion variables can come from options to the
# script.
$InstallDir = "./cli-tools"
$CliVersion = "1.0.1"
# Test the path provided by $InstallDir to confirm it exists. If it
# does, it's removed. This is not strictly required, but it's …Run Code Online (Sandbox Code Playgroud)