44# # cache. Should run after VS and Node
55# ###############################################################################
66
7- # ensure temp
8- New-Item - Path C:\Temp - Force - ItemType Directory
9-
107# Set environment variables
118Set-SystemVariable - SystemVariable DOTNET_MULTILEVEL_LOOKUP - Value " 0"
129Set-SystemVariable - SystemVariable DOTNET_NOLOGO - Value " 1"
1310Set-SystemVariable - SystemVariable DOTNET_SKIP_FIRST_TIME_EXPERIENCE - Value " 1"
1411
1512[Net.ServicePointManager ]::SecurityProtocol = [Net.ServicePointManager ]::SecurityProtocol -bor " Tls12"
1613
14+ # region "Functions"
1715function Get-SDKVersionsToInstall (
1816 $DotnetVersion
1917) {
@@ -52,18 +50,6 @@ function Invoke-Warmup (
5250 }
5351}
5452
55- function Fix-ImportPublishProfile (
56- $SdkVersion
57- ) {
58- if (Test-IsWin19 ) {
59- # Fix for issue https://github.com/dotnet/sdk/issues/1276. This will be fixed in 3.1.
60- $sdkTargetsName = " Microsoft.NET.Sdk.ImportPublishProfile.targets"
61- $sdkTargetsUrl = " https://raw.githubusercontent.com/dotnet/sdk/82bc30c99f1325dfaa7ad450be96857a4fca2845/src/Tasks/Microsoft.NET.Build.Tasks/targets/${sdkTargetsName} "
62- $sdkTargetsPath = " C:\Program Files\dotnet\sdk\$sdkVersion \Sdks\Microsoft.NET.Sdk\targets"
63- Start-DownloadWithRetry - Url $sdkTargetsUrl - DownloadPath $sdkTargetsPath - Name $sdkTargetsName
64- }
65- }
66-
6753function InstallSDKVersion (
6854 $SdkVersion ,
6955 $Warmup
@@ -72,15 +58,13 @@ function InstallSDKVersion (
7258 if (! (Test-Path - Path " C:\Program Files\dotnet\sdk\$sdkVersion " ))
7359 {
7460 Write-Host " Installing dotnet $sdkVersion "
75- .\dotnet- install.ps1 - Architecture x64 - Version $sdkVersion - InstallDir $ (Join-Path - Path $env: ProgramFiles - ChildPath ' dotnet' )
61+ .\dotnet- install.ps1 - Version $sdkVersion - InstallDir $ (Join-Path - Path $env: ProgramFiles - ChildPath ' dotnet' )
7662 }
7763 else
7864 {
7965 Write-Host " Sdk version $sdkVersion already installed"
8066 }
8167
82- Fix- ImportPublishProfile - SdkVersion $SdkVersion
83-
8468 if ($Warmup ) {
8569 Invoke-Warmup - SdkVersion $SdkVersion
8670 }
@@ -138,6 +122,7 @@ function RunPostInstallationSteps()
138122 # Add %USERPROFILE%\.dotnet\tools to USER PATH
139123 Add-DefaultPathItem " %USERPROFILE%\.dotnet\tools"
140124}
125+ # endregion
141126
142127InstallAllValidSdks
143128RunPostInstallationSteps
0 commit comments