mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-23 03:51:07 +07:00
187843cd79
* Add installer * Add tests * install-dotnet script should be in externals * merge * Fix tests * Fix naming * Clean up * Feedback
18 lines
620 B
PowerShell
18 lines
620 B
PowerShell
function Get-Machine-Architecture()
|
|
{
|
|
# possible values: AMD64, IA64, x86
|
|
return $ENV:PROCESSOR_ARCHITECTURE
|
|
}
|
|
|
|
function Get-CLIArchitecture-From-Architecture([string]$Architecture)
|
|
{
|
|
switch ($Architecture.ToLower())
|
|
{
|
|
{ ($_ -eq "amd64") -or ($_ -eq "x64") } { return "x64" }
|
|
{ $_ -eq "x86" } { return "x86" }
|
|
default { throw "Architecture not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" }
|
|
}
|
|
}
|
|
|
|
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $(Get-Machine-Architecture)
|
|
Write-Output "Primary:win-$CLIArchitecture" |