Skip to content

Commit 16ae243

Browse files
committed
Fix tostring method for portable version
1 parent a3e81e1 commit 16ae243

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ function ConvertTo-PortableVersion {
372372
# type in script, we need a way to find the highest version of dotnet, it's not a great solution
373373
# but it will work in most cases.
374374
Add-Member -inputobject $customObject -Type ScriptMethod -Name ToString -Force -Value {
375-
$str = "{0:0000}.{1:0000}.{2:0000}.{3:0000}" -f $this.Major,$this.Minor,$this.Patch
375+
$str = "{0:0000}.{1:0000}.{2:0000}" -f $this.Major,$this.Minor,$this.Patch
376376
if ( $this.PrereleaseLabel ) {
377377
$str += "-{0}" -f $this.PrereleaseLabel
378378
}
@@ -509,7 +509,7 @@ function Get-DotnetExe
509509
# version in global.json will produce an error, so we can only take the dotnet which executes
510510
$latestDotnet = $discoveredDotNet |
511511
Where-Object { try { & $_ --version 2>$null } catch { } } |
512-
Sort-Object { $pv = ConvertTo-PortableVersion (& $_ --version 2>$null ); "$pv" } |
512+
Sort-Object { $pv = ConvertTo-PortableVersion (& $_ --version 2>$null); "$pv" } |
513513
Select-Object -Last 1
514514
if ( $latestDotnet ) {
515515
Write-Verbose -Verbose "Found dotnet here: $latestDotnet"

0 commit comments

Comments
 (0)