Skip to content

Commit 921db70

Browse files
fengzhou-msftazure-sdk
authored andcommitted
Update Automation-Sdk-Init.ps1
1 parent fbd5b9b commit 921db70

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

eng/scripts/Automation-Sdk-Init.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,16 @@ $GlobalJson = Get-Content -Raw -Path (Join-Path $RepoRoot 'global.json') | Conve
3737
$dotnetSdkVersion = $GlobalJson.sdk.version
3838

3939
$installScript = GetDotNetInstallScript
40-
41-
$dotnet = Join-Path $RepoRoot "../dotnetsdk"
40+
41+
if (-not (Test-Path Env:AGENT_TOOLSDIRECTORY))
42+
{
43+
$Env:AGENT_TOOLSDIRECTORY = Join-Path $RepoRoot ".."
44+
}
45+
Write-Host $Env:AGENT_TOOLSDIRECTORY
46+
$dotnet = Join-Path $Env:AGENT_TOOLSDIRECTORY "dotnetsdk"
4247
& bash $installScript --install-dir $dotnet --version $dotnetSdkVersion
4348

44-
$env:PATH = "$dotnet`:" + $env:PATH
49+
$Env:PATH = "$dotnet`:" + $Env:PATH
4550
dotnet --version | Write-Host
4651

4752
if (Test-Path $installScript) {

0 commit comments

Comments
 (0)