From c56fa2213c5a352d1254dd47c7e56441a0e10b91 Mon Sep 17 00:00:00 2001 From: SeeminglyScience Date: Mon, 28 Feb 2022 13:20:38 -0500 Subject: [PATCH] Account for preview versions of dotnet sdk Fixes #1730 --- PowerShellEditorServices.build.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1 index 7169a2ab7..716441da3 100644 --- a/PowerShellEditorServices.build.ps1 +++ b/PowerShellEditorServices.build.ps1 @@ -55,7 +55,10 @@ if (Get-Command git -ErrorAction SilentlyContinue) { task FindDotNet { assert (Get-Command dotnet -ErrorAction SilentlyContinue) "dotnet not found, please install it: https://aka.ms/dotnet-cli" - assert ([Version](dotnet --version) -ge [Version]("6.0")) ".NET SDK 6.0 or higher is required, please update it: https://aka.ms/dotnet-cli" + + # Strip out semantic version metadata so it can be cast to `Version` + $existingVersion, $null = (dotnet --version) -split '-' + assert ([Version]$existingVersion -ge [Version]("6.0")) ".NET SDK 6.0 or higher is required, please update it: https://aka.ms/dotnet-cli" # Anywhere other than on a Mac with an M1 processor, we additionally # need the .NET 3.1 runtime for our netcoreapp3.1 framework.