File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 85
85
86
86
$toolPath = "$(System.DefaultWorkingDirectory)/toolPath/${{ parameters.globalToolExeName }}"
87
87
88
- Find-Dotnet -SetDotNetRoot
88
+ $source = (get-command -Type Application -Name dotnet | Select-Object -First 1 -ExpandProperty source)
89
+ $target = (Get-ChildItem $source).target
89
90
91
+ # If we find a symbolic link for dotnet, then we need to split the filename off the target.
92
+ if ($target) {
93
+ Write-Verbose -Verbose "Splitting target: $target"
94
+ $target = Split-Path $target
95
+ }
96
+
97
+ Write-Verbose -Verbose "target is set as $target"
98
+
99
+ $env:DOTNET_ROOT = (resolve-path -Path (Join-Path (split-path $source) $target)).ProviderPath
90
100
Write-Verbose -Verbose "DOTNET_ROOT: $env:DOTNET_ROOT"
91
101
Get-ChildItem $env:DOTNET_ROOT
92
102
You can’t perform that action at this time.
0 commit comments