If the user has multiple dotnet CLIs on their path, the DOTNET_INSTALL_DIR value gets corrupted because this code doesn't properly select the first result:
https://github.com/dotnet/arcade-minimalci-sample/blob/a249ce8e79a9b71d5367d7bc59132121a7490d5b/eng/common/tools.ps1#L36-L38
On my machine, where the PATH search yields multiple results, DOTNET_INSTALL_DIR ends up being set to multiple directories:

This causes the search for the correct SDK version to fail, and Arcade changes to use a repo-local .dotnet directory, which is definitely not what I wanted :).
A simple patch to add | select -first 1 on the end fixes this for PowerShell. Haven't checked if this occurs in Bash as well.
If the user has multiple dotnet CLIs on their path, the DOTNET_INSTALL_DIR value gets corrupted because this code doesn't properly select the first result:
https://github.com/dotnet/arcade-minimalci-sample/blob/a249ce8e79a9b71d5367d7bc59132121a7490d5b/eng/common/tools.ps1#L36-L38
On my machine, where the PATH search yields multiple results, DOTNET_INSTALL_DIR ends up being set to multiple directories:
This causes the search for the correct SDK version to fail, and Arcade changes to use a repo-local
.dotnetdirectory, which is definitely not what I wanted :).A simple patch to add
| select -first 1on the end fixes this for PowerShell. Haven't checked if this occurs in Bash as well.