Skip to content

Commit

Permalink
Reduce unneeded verbose message
Browse files Browse the repository at this point in the history
  • Loading branch information
daxian-dbw committed May 9, 2022
1 parent 4af204f commit 69d0c4f
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions build.psm1
Expand Up @@ -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 {
Expand Down

0 comments on commit 69d0c4f

Please sign in to comment.