Skip to content

Commit ea0ab84

Browse files
authored
Reduce unneeded verbose message from build.psm1 (PowerShell#17291)
1 parent 6c33ebd commit ea0ab84

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

build.psm1

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,7 @@ function Install-Dotnet {
19491949

19501950
$psArgs += @('-SkipNonVersionedFiles')
19511951

1952-
$psArgs | Out-String | Write-Verbose -Verbose
1952+
$psArgs -join ' ' | Write-Verbose -Verbose
19531953

19541954
Start-NativeExecution {
19551955
& $fullPSPath @psArgs
@@ -2195,21 +2195,21 @@ function Start-PSBootstrap {
21952195
}
21962196

21972197
function Get-LatestInstalledSDK {
2198-
Start-NativeExecution -sb {
2199-
dotnet --list-sdks | ForEach-Object {
2200-
# this splits strings like
2201-
# '6.0.202 [C:\Program Files\dotnet\sdk]'
2202-
# '7.0.100-preview.2.22153.17 [C:\Users\johndoe\AppData\Local\Microsoft\dotnet\sdk]'
2203-
# into version and path parts.
2204-
$version, $null = $_ -split '\s',2
2205-
try {
2206-
[System.Management.Automation.SemanticVersion]::new($version)
2207-
}
2208-
catch {
2209-
Write-Warning -Message "Unable to parse dotnet version semantically: $version"
2210-
}
2211-
} | Sort-Object -Descending | Select-Object -First 1
2212-
} -IgnoreExitcode 2> $null
2198+
$output = Start-NativeExecution -sb { dotnet --list-sdks } -IgnoreExitcode 2> $null
2199+
2200+
$output | ForEach-Object {
2201+
# this splits strings like
2202+
# '6.0.202 [C:\Program Files\dotnet\sdk]'
2203+
# '7.0.100-preview.2.22153.17 [C:\Users\johndoe\AppData\Local\Microsoft\dotnet\sdk]'
2204+
# into version and path parts.
2205+
$version, $null = $_ -split '\s',2
2206+
try {
2207+
[System.Management.Automation.SemanticVersion]::new($version)
2208+
}
2209+
catch {
2210+
Write-Warning -Message "Unable to parse dotnet version semantically: $version"
2211+
}
2212+
} | Sort-Object -Descending | Select-Object -First 1
22132213
}
22142214

22152215
function Start-DevPowerShell {

0 commit comments

Comments
 (0)