setup-dotnet/externals/get-os-platform.ps1
Patreos98 a6fda504d5 Revert "Merge branch 'main' into dependabot/npm_and_yarn/node-fetch-2.6.1"
This reverts commit b8c9c25ab1d423e5c3aefb3903399a6c1b64bae3, reversing
changes made to 19ffec8f3e520e1f08af6a7583b84852f6e6f0fe.
2020-09-20 18:11:25 +02: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"