setup-dotnet/externals/get-os-platform.ps1
Danny McCormick 187843cd79
Add installer (#1)
* Add installer

* Add tests

* install-dotnet script should be in externals

* merge

* Fix tests

* Fix naming

* Clean up

* Feedback
2019-06-21 08:21:08 -04:00

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"