From 69d0c4f840bf32b1d9508ba41e229d88616b680f Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 9 May 2022 10:05:47 -0700 Subject: [PATCH 1/2] Reduce unneeded verbose message --- build.psm1 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/build.psm1 b/build.psm1 index 3648e0f0d014..0cbd5a59a73b 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2195,21 +2195,21 @@ function Start-PSBootstrap { } function Get-LatestInstalledSDK { - Start-NativeExecution -sb { - dotnet --list-sdks | ForEach-Object { - # this splits strings like - # '6.0.202 [C:\Program Files\dotnet\sdk]' - # '7.0.100-preview.2.22153.17 [C:\Users\johndoe\AppData\Local\Microsoft\dotnet\sdk]' - # into version and path parts. - $version, $null = $_ -split '\s',2 - try { - [System.Management.Automation.SemanticVersion]::new($version) - } - catch { - Write-Warning -Message "Unable to parse dotnet version semantically: $version" - } - } | Sort-Object -Descending | Select-Object -First 1 - } -IgnoreExitcode 2> $null + $output = Start-NativeExecution -sb { dotnet --list-sdks } -IgnoreExitcode 2> $null + + $output | ForEach-Object { + # this splits strings like + # '6.0.202 [C:\Program Files\dotnet\sdk]' + # '7.0.100-preview.2.22153.17 [C:\Users\johndoe\AppData\Local\Microsoft\dotnet\sdk]' + # into version and path parts. + $version, $null = $_ -split '\s',2 + try { + [System.Management.Automation.SemanticVersion]::new($version) + } + catch { + Write-Warning -Message "Unable to parse dotnet version semantically: $version" + } + } | Sort-Object -Descending | Select-Object -First 1 } function Start-DevPowerShell { From 96792b4bd90bac0a3ba5ab017dc329dd17bb30cd Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 9 May 2022 17:01:50 -0700 Subject: [PATCH 2/2] Fix another verbose message --- build.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 0cbd5a59a73b..92f398ea1d47 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1949,7 +1949,7 @@ function Install-Dotnet { $psArgs += @('-SkipNonVersionedFiles') - $psArgs | Out-String | Write-Verbose -Verbose + $psArgs -join ' ' | Write-Verbose -Verbose Start-NativeExecution { & $fullPSPath @psArgs