diff options
author | Andrew Arnott <andrewarnott@live.com> | 2021-11-03 22:37:52 +0300 |
---|---|---|
committer | Andrew Arnott <andrewarnott@live.com> | 2021-11-03 22:37:52 +0300 |
commit | e630a16dd01615dbfbd6fc468b81b3546749344e (patch) | |
tree | 2e6adc8f6db1457a22d8c3e873383e3efa0066fc | |
parent | cb0735423cd2b05d4ac2f40c092c2226b19941bb (diff) |
Install ASP.NET runtime
-rwxr-xr-x | tools/Install-DotNetSdk.ps1 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index a8407a32..fac05df7 100755 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -208,6 +208,22 @@ $windowsDesktopRuntimeVersions | Sort-Object -Unique |% { } } +$aspnetRuntimeSwitches = $switches + '-Runtime','aspnetcore' + +$runtimeVersions | Sort-Object -Unique |% { + if ($PSCmdlet.ShouldProcess(".NET Core ASP.NET runtime $_", "Install")) { + $anythingInstalled = $true + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ $aspnetRuntimeSwitches" + + if ($LASTEXITCODE -ne 0) { + Write-Error ".NET SDK installation failure: $LASTEXITCODE" + exit $LASTEXITCODE + } + } else { + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ $aspnetRuntimeSwitches -DryRun" + } +} + if ($PSCmdlet.ShouldProcess("Set DOTNET environment variables to discover these installed runtimes?")) { & "$PSScriptRoot/Set-EnvVars.ps1" -Variables $envVars -PrependPath $DotNetInstallDir | Out-Null } |