dotnet / install-scripts

MIT License
145 stars 76 forks source link

Can't install dotnet on macOS using pwsh (PowerShell 7) #550

Closed alexlogvin closed 1 week ago

alexlogvin commented 1 week ago

I run the same PowerShell command on both Windows and macOS machines to install dotnet SDK:

Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile _.ps1; ./_.ps1 -InstallDir $(dotnetFolder) -JSonFile $(globalFile)

On Windows it works great but on macOS it fails with the following error:

Exception: /Users/build/azure_agent/_work/2/s/_.ps1:278
Line |
 278 |  …   default { throw "Architecture '$Architecture' not supported. If you …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Architecture '' not supported. If you think this is a bug, report it at
     | https://github.com/dotnet/install-scripts/issues

Before i was using this Bash command for macOS which works great:

curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --install-dir $(dotnetFolder) --jsonfile $(globalFile)

Is it possible to use PowerShell and dotnet-install.ps1 to install dotnet SDK on macOS?

JanProvaznik commented 1 week ago

This is not supported https://github.com/dotnet/install-scripts/issues/417 please use the sh script on MacOS.