@@ -277,7 +277,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) {
277277
278278 Retry({
279279 Write-Host " GET $uri "
280- Invoke-WebRequest $uri - OutFile $installScript
280+ Invoke-WebRequest $uri - UseBasicParsing - OutFile $installScript
281281 })
282282 }
283283
@@ -394,8 +394,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
394394
395395 # If the version of msbuild is going to be xcopied,
396396 # use this version. Version matches a package here:
397- # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.13 .0
398- $defaultXCopyMSBuildVersion = ' 17.13 .0'
397+ # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/18.0 .0
398+ $defaultXCopyMSBuildVersion = ' 18.0 .0'
399399
400400 if (! $vsRequirements ) {
401401 if (Get-Member - InputObject $GlobalJson.tools - Name ' vs' ) {
@@ -510,7 +510,7 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
510510 Write-Host " Downloading $packageName $packageVersion "
511511 $ProgressPreference = ' SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
512512 Retry({
513- Invoke-WebRequest " https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/flat2/$packageName /$packageVersion /$packageName .$packageVersion .nupkg" - OutFile $packagePath
513+ Invoke-WebRequest " https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/flat2/$packageName /$packageVersion /$packageName .$packageVersion .nupkg" - UseBasicParsing - OutFile $packagePath
514514 })
515515
516516 if (! (Test-Path $packagePath )) {
@@ -556,23 +556,30 @@ function LocateVisualStudio([object]$vsRequirements = $null){
556556 Write-Host " Downloading vswhere $vswhereVersion "
557557 $ProgressPreference = ' SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
558558 Retry({
559- Invoke-WebRequest " https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/vswhere/$vswhereVersion /vswhere.exe" - OutFile $vswhereExe
559+ Invoke-WebRequest " https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/vswhere/$vswhereVersion /vswhere.exe" - UseBasicParsing - OutFile $vswhereExe
560560 })
561561 }
562562
563- if (! $vsRequirements ) { $vsRequirements = $GlobalJson.tools.vs }
563+ if (! $vsRequirements ) {
564+ if (Get-Member - InputObject $GlobalJson.tools - Name ' vs' - ErrorAction SilentlyContinue) {
565+ $vsRequirements = $GlobalJson.tools.vs
566+ } else {
567+ $vsRequirements = $null
568+ }
569+ }
570+
564571 $args = @ (' -latest' , ' -format' , ' json' , ' -requires' , ' Microsoft.Component.MSBuild' , ' -products' , ' *' )
565572
566573 if (! $excludePrereleaseVS ) {
567574 $args += ' -prerelease'
568575 }
569576
570- if (Get-Member - InputObject $vsRequirements - Name ' version' ) {
577+ if ($vsRequirements -and ( Get-Member - InputObject $vsRequirements - Name ' version' - ErrorAction SilentlyContinue) ) {
571578 $args += ' -version'
572579 $args += $vsRequirements.version
573580 }
574581
575- if (Get-Member - InputObject $vsRequirements - Name ' components' ) {
582+ if ($vsRequirements -and ( Get-Member - InputObject $vsRequirements - Name ' components' - ErrorAction SilentlyContinue) ) {
576583 foreach ($component in $vsRequirements.components ) {
577584 $args += ' -requires'
578585 $args += $component
0 commit comments