[release/v7.4] Add default .NET install path for SDK validation (#25339)

Co-authored-by: Aditya Patwardhan <adityap@microsoft.com>
This commit is contained in:
PowerShell Team Bot
2025-04-28 18:06:19 +00:00
committed by GitHub
co-authored by Aditya Patwardhan
parent 128869e07a
commit e033cc418f
+10 -1
View File
@@ -87,7 +87,16 @@ jobs:
Get-Content $nugetPath
# Add workaround to unblock xUnit testing see issue: https://github.com/dotnet/sdk/issues/26462
$dotnetPath = if ($IsWindows) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" }
$possibleDotnetLocation = "$env:ProgramFiles\dotnet"
$dotnetPath = if ($IsWindows) {
if (Test-Path $possibleDotnetLocation) { $possibleDotnetLocation } else { "$env:LocalAppData\Microsoft\dotnet" }
}
else {
"$env:HOME/.dotnet"
}
$env:DOTNET_ROOT = $dotnetPath
dotnet --info