@@ -92,36 +92,42 @@ jobs:
92
92
$installDir = "$(Agent.ToolsDirectory)/dotnet"
93
93
94
94
ls -Recurse -Include global.json | %{
95
- Write-Host "Processing $_"
96
- $v = $_ | Get-Content -Raw | ConvertFrom-Json | %{ if ($_.tools.dotnet) {$_.tools.dotnet} else {$_.sdk.version} }
97
- if (-not $v)
98
- {
99
- Write-Host "No version found in $_"
100
- return
101
- }
102
- $isSensibleVersion = $v.Split('.')[0] -as [int] -le 30
103
- if (-not $isSensibleVersion)
104
- {
105
- Write-Host "Skipping bogus version $v"
106
- return
107
- }
95
+ try {
96
+ Write-Host "Processing $_"
97
+ $v = $_ | Get-Content -Raw | ConvertFrom-Json | %{ if ($_.tools.dotnet) {$_.tools.dotnet} else {$_.sdk.version} }
98
+ if (-not $v)
99
+ {
100
+ Write-Host "No version found in $_"
101
+ return
102
+ }
103
+ $isSensibleVersion = $v.Split('.')[0] -as [int] -le 30
104
+ if (-not $isSensibleVersion)
105
+ {
106
+ Write-Host "Skipping bogus version $v"
107
+ return
108
+ }
108
109
109
- Write-Host "Installing .NET CLI version $v"
110
- try
111
- {
112
- & $installScript -Version $v -InstallDir $installDir -NoPath
113
- }
114
- catch
115
- {
110
+ Write-Host "Installing .NET CLI version $v"
116
111
try
117
112
{
118
- & $installScript -Version $v -InstallDir $installDir -NoPath -AzureFeed https://dotnetbuilds.azureedge.net/public
113
+ & $installScript -Version $v -InstallDir $installDir -NoPath
119
114
}
120
115
catch
121
116
{
122
- throw "Unable to install Version $v"
117
+ try
118
+ {
119
+ & $installScript -Version $v -InstallDir $installDir -NoPath -AzureFeed https://dotnetbuilds.azureedge.net/public
120
+ }
121
+ catch
122
+ {
123
+ throw "Unable to install Version $v"
124
+ }
123
125
}
124
126
}
127
+ catch
128
+ {
129
+ Write-Host "Skipping bad json file."
130
+ }
125
131
}
126
132
displayName: 'Install Required Versions of .NET Core'
127
133
0 commit comments