@@ -1949,7 +1949,7 @@ function Install-Dotnet {
1949
1949
1950
1950
$psArgs += @ (' -SkipNonVersionedFiles' )
1951
1951
1952
- $psArgs | Out-String | Write-Verbose - Verbose
1952
+ $psArgs -join ' ' | Write-Verbose - Verbose
1953
1953
1954
1954
Start-NativeExecution {
1955
1955
& $fullPSPath @psArgs
@@ -2195,21 +2195,21 @@ function Start-PSBootstrap {
2195
2195
}
2196
2196
2197
2197
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
2213
2213
}
2214
2214
2215
2215
function Start-DevPowerShell {
0 commit comments