From 8889c6748fdf4e4b43c23d9a0b3abdc7d6464246 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 4 Feb 2021 12:31:39 +0300 Subject: [PATCH] Debug --- __tests__/verify-dotnet.ps1 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/__tests__/verify-dotnet.ps1 b/__tests__/verify-dotnet.ps1 index 9193ce1..eb4dac0 100755 --- a/__tests__/verify-dotnet.ps1 +++ b/__tests__/verify-dotnet.ps1 @@ -17,9 +17,16 @@ if ($version -notmatch $args[0]) if ($args[1]) { # SDKs are listed on multiple lines with the path afterwards in square brackets - $versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } | Out-String - Write-Host "Version $versions" - if ($versions -notmatch $args[1]) + $versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } + Write-Host "Installed versions: $versions" + $isInstalledVersion = $false + foreach ($version in $versions) { + if ($version.StartsWith($args[1])) { + $isInstalledVersion = $true + break + } + } + if (-not $isInstalledVersion) { Write-Host "PATH='$env:PATH'" throw "Unexpected version"