Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Safonkin committed Feb 4, 2021
1 parent 5d1a72c commit a841c56
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions __tests__/verify-dotnet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Write-Host "Found '$dotnet'"

$version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() }
Write-Host "Version $version"
if ($version -notmatch $args[0])
if (-not ($version.StartsWith($args[0])))
{
Write-Host "PATH='$env:PATH'"
throw "Unexpected version"
Expand All @@ -20,8 +20,10 @@ if ($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].ToString())) {
foreach ($version in $versions)
{
if ($version.StartsWith($args[1].ToString()))
{
$isInstalledVersion = $true
break
}
Expand Down

0 comments on commit a841c56

Please sign in to comment.