@@ -52,12 +52,15 @@ if (Get-Command git -ErrorAction SilentlyContinue) {
52
52
53
53
function Install-Dotnet {
54
54
param (
55
- [string []]$Channel
55
+ [string []]$Channel ,
56
+ # Install just the runtime, not the SDK
57
+ [switch ]$Runtime
56
58
)
57
59
58
60
$env: DOTNET_INSTALL_DIR = " $PSScriptRoot /.dotnet"
59
61
60
- Write-Host " Installing .NET channels $Channel " - ForegroundColor Green
62
+ $components = if ($Runtime ) { " Runtime" } else { " SDK and Runtime" }
63
+ Write-Host " Installing .NET $components $Channel " - ForegroundColor Green
61
64
62
65
# The install script is platform-specific
63
66
$installScriptExt = if ($script :IsNix ) { " sh" } else { " ps1" }
@@ -79,6 +82,7 @@ function Install-Dotnet {
79
82
$params = if ($script :IsNix )
80
83
{
81
84
@ (' -Channel' , $dotnetChannel , ' -InstallDir' , $env: DOTNET_INSTALL_DIR , ' -NoPath' , ' -Verbose' )
85
+ if ($Runtime ) { $Params += @ (' -Runtime' , ' dotnet' ) }
82
86
}
83
87
else
84
88
{
@@ -88,8 +92,10 @@ function Install-Dotnet {
88
92
NoPath = $true
89
93
Verbose = $true
90
94
}
95
+ if ($Runtime ) { $Params [' Runtime' ] = ' dotnet' }
91
96
}
92
97
98
+
93
99
& $installScriptPath @params
94
100
95
101
Write-Host " `n ### Installation complete for version $Version ."
@@ -107,7 +113,8 @@ task SetupDotNet -Before Clean, Build, TestServerWinPS, TestServerPS7, TestServe
107
113
108
114
if (! (Test-Path $dotnetExePath )) {
109
115
# TODO: Test .NET 5 with PowerShell 7.1
110
- Install-Dotnet - Channel ' 3.1' , ' 5.0' , ' 6.0'
116
+ Install-Dotnet - Channel ' 6.0' # SDK and runtime
117
+ Install-Dotnet - Channel ' 3.1' , ' 5.0' - Runtime # Runtime only
111
118
}
112
119
113
120
# This variable is used internally by 'dotnet' to know where it's installed
0 commit comments