Skip to content

Commit 1747530

Browse files
committed
add -Raw flag to Get-GlobalJsonSdkVersion
Sometimes we need the raw version so the installation script works, but sometimes we need to be able to compare it with other versions.
1 parent 16ae243 commit 1747530

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

build.psm1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ function Install-Dotnet
294294
[CmdletBinding(SupportsShouldProcess=$true)]
295295
param (
296296
[Parameter()][Switch]$Force,
297-
[Parameter()]$version = $( Get-GlobalJsonSdkVersion )
297+
[Parameter()]$version = $( Get-GlobalJsonSdkVersion -Raw )
298298
)
299299

300300
if ( Test-DotnetInstallation -requestedversion $version ) {
@@ -332,9 +332,15 @@ function Install-Dotnet
332332
}
333333

334334
function Get-GlobalJsonSdkVersion {
335+
param ( [switch]$Raw )
335336
$json = Get-Content -raw (Join-Path $PSScriptRoot global.json) | ConvertFrom-Json
336337
$version = $json.sdk.Version
337-
ConvertTo-PortableVersion $version
338+
if ( $Raw ) {
339+
return $version
340+
}
341+
else {
342+
ConvertTo-PortableVersion $version
343+
}
338344
}
339345

340346
# we don't have semantic version in earlier versions of PowerShell, so we need to

0 commit comments

Comments
 (0)