@@ -30,12 +30,8 @@ Param(
3030)
3131
3232$FakeVersion = " 4.61.2"
33- $DotNetChannel = " LTS" ;
34- $DotNetVersion = " 3.1.100" ;
35- $DotNetInstallerUri = " https://dot.net/v1/dotnet-install.ps1" ;
3633$NugetVersion = " 4.1.0" ;
3734$NugetUrl = " https://dist.nuget.org/win-x86-commandline/v$NugetVersion /nuget.exe"
38- $ProtobufVersion = " 3.4.0"
3935$DocfxVersion = " 2.49.0"
4036
4137# Make sure tools folder exists
@@ -46,50 +42,6 @@ if (!(Test-Path $ToolPath)) {
4642 New-Item - Path $ToolPath - Type directory | out-null
4743}
4844
49- # ##########################################################################
50- # INSTALL .NET CORE CLI
51- # ##########################################################################
52-
53- Function Remove-PathVariable ([string ]$VariableToRemove )
54- {
55- $path = [Environment ]::GetEnvironmentVariable(" PATH" , " User" )
56- if ($path -ne $null )
57- {
58- $newItems = $path.Split (' ;' , [StringSplitOptions ]::RemoveEmptyEntries) | Where-Object { " $ ( $_ ) " -inotlike $VariableToRemove }
59- [Environment ]::SetEnvironmentVariable(" PATH" , [System.String ]::Join(' ;' , $newItems ), " User" )
60- }
61-
62- $path = [Environment ]::GetEnvironmentVariable(" PATH" , " Process" )
63- if ($path -ne $null )
64- {
65- $newItems = $path.Split (' ;' , [StringSplitOptions ]::RemoveEmptyEntries) | Where-Object { " $ ( $_ ) " -inotlike $VariableToRemove }
66- [Environment ]::SetEnvironmentVariable(" PATH" , [System.String ]::Join(' ;' , $newItems ), " Process" )
67- }
68- }
69-
70- # Get .NET Core CLI path if installed.
71- $FoundDotNetCliVersion = $null ;
72- if (Get-Command dotnet - ErrorAction SilentlyContinue) {
73- $FoundDotNetCliVersion = dotnet -- version;
74- $env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
75- $env: DOTNET_CLI_TELEMETRY_OPTOUT = 1
76- }
77-
78- if ($FoundDotNetCliVersion -ne $DotNetVersion ) {
79- $InstallPath = Join-Path $PSScriptRoot " .dotnet"
80- if (! (Test-Path $InstallPath )) {
81- mkdir - Force $InstallPath | Out-Null ;
82- }
83- (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri , " $InstallPath \dotnet-install.ps1" );
84- & $InstallPath \dotnet- install.ps1 - Channel $DotNetChannel - Version $DotNetVersion - InstallDir $InstallPath - Architecture x64;
85-
86- Remove-PathVariable " $InstallPath "
87- $env: PATH = " $InstallPath ;$env: PATH "
88- $env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
89- $env: DOTNET_CLI_TELEMETRY_OPTOUT = 1
90- $env: DOTNET_ROOT = $InstallPath
91- }
92-
9345# ##########################################################################
9446# INSTALL NUGET
9547# ##########################################################################
0 commit comments