This commit is contained in:
Vladimir Safonkin 2021-02-04 12:18:06 +03:00
parent 44b8627225
commit 7164f75e01
1 changed files with 5 additions and 5 deletions

View File

@ -10,18 +10,18 @@ $version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() }
Write-Host "Version $version"
if ($version -notmatch $args[0])
{
Write-Host "PATH='$env:path'"
Write-Host "PATH='$env:PATH'"
throw "Unexpected version"
}
if ($args[1])
{
# SDKs are listed on multiple lines with the path afterwards in square brackets
$version = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() }
Write-Host "Version $version"
if (-not ($version -contains $args[1]))
$versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() } | Out-String
Write-Host "Version $versions"
if ($version -notmatch $args[1])
{
Write-Host "PATH='$env:path'"
Write-Host "PATH='$env:PATH'"
throw "Unexpected version"
}
}