Check powershell version. (#27596)

This commit is contained in:
KyleWong
2019-02-07 06:37:47 +08:00
committed by xster
parent da27f62337
commit cf612a4299

View File

@@ -23,6 +23,15 @@ $engineVersion = (Get-Content "$flutterRoot\bin\internal\engine.version")
$oldDartSdkPrefix = "dart-sdk.old"
# Make sure that PowerShell has expected version.
$psMajorVersionRequired = 5
$psMajorVersionLocal = $PSVersionTable.PSVersion.Major
if ($psMajorVersionLocal -lt $psMajorVersionRequired) {
Write-Host "Flutter requires PowerShell $psMajorVersionRequired.0 or newer."
Write-Host "See https://flutter.io/docs/get-started/install/windows for more."
return
}
if ((Test-Path $engineStamp) -and ($engineVersion -eq (Get-Content $engineStamp))) {
return
}