dotnet-install.ps1 786 B

12345678910111213141516171819202122232425262728
  1. [CmdletBinding(PositionalBinding=$false)]
  2. Param(
  3. [string] $verbosity = 'minimal',
  4. [string] $architecture = '',
  5. [string] $version = 'Latest',
  6. [string] $runtime = 'dotnet',
  7. [string] $RuntimeSourceFeed = '',
  8. [string] $RuntimeSourceFeedKey = ''
  9. )
  10. . $PSScriptRoot\tools.ps1
  11. $dotnetRoot = Join-Path $RepoRoot '.dotnet'
  12. $installdir = $dotnetRoot
  13. try {
  14. if ($architecture -and $architecture.Trim() -eq 'x86') {
  15. $installdir = Join-Path $installdir 'x86'
  16. }
  17. InstallDotNet $installdir $version $architecture $runtime $true -RuntimeSourceFeed $RuntimeSourceFeed -RuntimeSourceFeedKey $RuntimeSourceFeedKey
  18. }
  19. catch {
  20. Write-Host $_.ScriptStackTrace
  21. Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
  22. ExitWithExitCode 1
  23. }
  24. ExitWithExitCode 0