Skip to content

Commit 5b4bacb

Browse files
authored
give explicit error on unsupported versions of pscore and document it (#1049)
1 parent 8ae2587 commit 5b4bacb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Engine/PSScriptAnalyzer.psm1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ $binaryModuleRoot = $PSModuleRoot
1313

1414
if (($PSVersionTable.Keys -contains "PSEdition") -and ($PSVersionTable.PSEdition -ne 'Desktop')) {
1515
$binaryModuleRoot = Join-Path -Path $PSModuleRoot -ChildPath 'coreclr'
16+
if ($PSVersionTable.PSVersion -lt [version]'6.0.2') {
17+
throw "Minimum supported version of PSScriptAnalyzer for PowerShell Core is 6.0.2 but current version is '$($PSVersionTable.PSVersion)'. Please update PowerShell Core."
18+
}
1619
}
1720
else {
1821
if ($PSVersionTable.PSVersion.Major -eq 3) {

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Exit
7676
#### Supported PowerShell Versions and Platforms
7777

7878
- Windows PowerShell 3.0 or greater
79-
- PowerShell Core on Windows/Linux/macOS
79+
- PowerShell Core 6.0.2 or greater on Windows/Linux/macOS
8080
- Docker (tested only using Docker CE on Windows 10 1803
8181
- 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):
8282

0 commit comments

Comments
 (0)