Skip to content

Commit 013c04e

Browse files
committed
Update azure-pipelines.yml for Azure Pipelines
1 parent 07bb4bb commit 013c04e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

azure-pipelines.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ variables:
1414
Configuration: Release
1515

1616
steps:
17+
- task: PowerShell@2
18+
displayName: 'Set default dotnet path'
19+
inputs:
20+
targetType: 'inline'
21+
script: |
22+
$infoContent = dotnet --info
23+
$sdkBasePath = $infoContent |
24+
Where-Object {$_ -match 'Base Path:'} |
25+
ForEach-Object {
26+
($_ -replace '\s+Base Path:','').trim()
27+
}
28+
Write-Host "dotnet SDK path: $sdkBasePath"
29+
$dotnetPath = (Get-Item $sdkBasePath).Parent.Parent.FullName
30+
Write-Host "dotnet path: $dotnetPath"
31+
Write-Host "##vso[task.setvariable variable=DotNetPath]$dotnetPath"
1732
- task: UseDotNet@2
1833
inputs:
1934
packageType: 'sdk'

0 commit comments

Comments
 (0)