diff --git a/eng/scripts/Automation-Sdk-Generate.ps1 b/eng/scripts/Automation-Sdk-Generate.ps1 index 9b82e3fe8383..b04a2b8d8a71 100644 --- a/eng/scripts/Automation-Sdk-Generate.ps1 +++ b/eng/scripts/Automation-Sdk-Generate.ps1 @@ -55,7 +55,12 @@ foreach ($path in $autorestFilesPath) { Write-Host "Updated autorest.md files for all the changed swaggers. `n" $packages = @() -$dotnet = Join-Path $RepoRoot "../dotnetsdk" +if (-not (Test-Path Env:AGENT_TOOLSDIRECTORY)) +{ + $Env:AGENT_TOOLSDIRECTORY = Join-Path $RepoRoot ".." +} +Write-Host $Env:AGENT_TOOLSDIRECTORY +$dotnet = Join-Path $Env:AGENT_TOOLSDIRECTORY "dotnetsdk" Write-Host "List dotnet directory" ls $dotnet | Write-Host $env:PATH = "$dotnet`:" + $env:PATH