From 32b403639d4aaca2ade99ae77bda449f10c689c1 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Sat, 28 Jul 2018 16:05:18 +0100 Subject: [PATCH] give explicit error on unsupported versions of pscore and document it --- Engine/PSScriptAnalyzer.psm1 | 3 +++ README.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Engine/PSScriptAnalyzer.psm1 b/Engine/PSScriptAnalyzer.psm1 index 6c88de4e7..4ced0d953 100644 --- a/Engine/PSScriptAnalyzer.psm1 +++ b/Engine/PSScriptAnalyzer.psm1 @@ -13,6 +13,9 @@ $binaryModuleRoot = $PSModuleRoot if (($PSVersionTable.Keys -contains "PSEdition") -and ($PSVersionTable.PSEdition -ne 'Desktop')) { $binaryModuleRoot = Join-Path -Path $PSModuleRoot -ChildPath 'coreclr' + if ($PSVersionTable.PSVersion -lt [version]'6.0.2') { + throw "Minimum supported version of PSScriptAnalyzer for PowerShell Core is 6.0.2 but current version is '$($PSVersionTable.PSVersion)'. Please update PowerShell Core." + } } else { if ($PSVersionTable.PSVersion.Major -eq 3) { diff --git a/README.md b/README.md index fc6a6684b..590afbb2b 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Exit #### Supported PowerShell Versions and Platforms - Windows PowerShell 3.0 or greater -- PowerShell Core on Windows/Linux/macOS +- PowerShell Core 6.0.2 or greater on Windows/Linux/macOS - Docker (tested only using Docker CE on Windows 10 1803 - PowerShell 6 Windows Image tags using from [microsoft/powershell](https://hub.docker.com/r/microsoft/powershell/): `nanoserver`, `6.0.2-nanoserver`, `6.0.2-nanoserver-1709`, `windowsservercore` and `6.0.2-windowsservercore`. Example (1 warning gets produced by `Save-Module` but can be ignored):