2021-11-16 23:32:22 +03:00
|
|
|
### This script is a quick way to install XHarness in a local folder.
|
|
|
|
### .NET SDK is installed too, everything in a local folder which can be deleted afterwards.
|
|
|
|
###
|
|
|
|
### Use the following command to run this script from anywhere:
|
|
|
|
### iex ((New-Object System.Net.WebClient).DownloadString('https://aka.ms/get-xharness-ps1'))
|
|
|
|
|
|
|
|
param (
|
|
|
|
[Parameter(Mandatory = $false)]
|
|
|
|
[string]
|
|
|
|
$Version = "*"
|
|
|
|
)
|
|
|
|
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
2024-09-04 17:53:21 +03:00
|
|
|
$xharness_version = "10.0.0-prerelease.$Version"
|
2021-11-16 23:32:22 +03:00
|
|
|
|
|
|
|
# Install .NET
|
|
|
|
Write-Host "Getting dotnet-install.ps1.." -ForegroundColor Cyan
|
|
|
|
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "dotnet-install.ps1"
|
|
|
|
|
|
|
|
Write-Host "Installing .NET SDK locally to " -NoNewline -ForegroundColor Cyan
|
|
|
|
Write-Host ".dotnet" -ForegroundColor Yellow
|
2023-01-18 19:27:30 +03:00
|
|
|
./dotnet-install.ps1 -InstallDir ./.dotnet -Channel 8.0
|
2021-11-16 23:32:22 +03:00
|
|
|
|
|
|
|
Write-Host ".NET installed" -ForegroundColor Cyan
|
|
|
|
Write-Host "Installing XHarness in current folder" -ForegroundColor Cyan
|
|
|
|
|
|
|
|
./.dotnet/dotnet tool install --tool-path . --version $xharness_version --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json Microsoft.DotNet.XHarness.CLI
|
|
|
|
|
2022-01-31 19:52:49 +03:00
|
|
|
Write-Host "Run following command: " -ForegroundColor Cyan -NoNewline
|
2022-04-26 16:31:20 +03:00
|
|
|
Write-Host "`$Env:DOTNET_ROOT='$pwd\.dotnet'" -ForegroundColor Yellow
|
2022-01-31 19:52:49 +03:00
|
|
|
Write-Host "Then run XHarness using: " -ForegroundColor Cyan -NoNewline
|
2021-11-16 23:32:22 +03:00
|
|
|
Write-Host ".\xharness help" -ForegroundColor Yellow
|