Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce unneeded verbose message from build.psm1 #17291

Merged
merged 2 commits into from May 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 16 additions & 16 deletions build.psm1
Expand Up @@ -1949,7 +1949,7 @@ function Install-Dotnet {

$psArgs += @('-SkipNonVersionedFiles')

$psArgs | Out-String | Write-Verbose -Verbose
$psArgs -join ' ' | Write-Verbose -Verbose

Start-NativeExecution {
& $fullPSPath @psArgs
Expand Down 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