-
Notifications
You must be signed in to change notification settings - Fork 394
Cannot import PSScriptAnalyzer 1.24.0 with PowerShell 7.4.5 or earlier #2106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Minimum PowerShell 7 version is 7.4.7 via the SMA reference here: PSScriptAnalyzer/Directory.Packages.props Line 12 in 4b4a136
PowerShell support policy is to update to latest patch version within one month of release of a new patch, therefore no need to support versions like 7.4.5 Therefore suggest to update to latest patch 7.4.10 What we could've done better is to update the version check here so that you'd have gotten a better error message https://github.com/PowerShell/PSScriptAnalyzer/blob/4b4a136d3b669a1fc127f182e7360160e4919acb/Engine/PSScriptAnalyzer.psm1#L12C12-L12C41 |
Thanks @bergmeister, that will help explain the issue and is a valid suggestion, but sometimes getting an updated version isn't that easy. In my case, I'm using self-hosted runners managed by a separate group in my company. For whatever reason, they are still using 7.4.1. It sucks that a patched PS version breaks PSSA compatibility. In my case, I pinned the PSSA version to 1.23, but that is not ideal since I know I am unlikely to remember to unpin it when the runners are updated to PS 7.4.7+ (whenever that is planned). MSLearn documentation also needs to be updated: |
Update: Removed the "on linux" condition from the title since we now know this issue will occur on all platforms. |
Uh oh!
There was an error while loading. Please reload this page.
Cannot import PSScriptAnalyzer 1.24.0 with PowerShell 7.4.5 or earlier
on Linux*. Attempting to do so fails with the following error:* Update: removed "on linux" since we now know this issue will occur on all platforms.
Steps to reproduce
Easiest way to repro is probably via a linux container with PowerShell installed:
In this example I am using
demisto/powershell-ubuntu:7.4.5.112371
but I was also able to repeat using an older .NET SDK container (mcr.microsoft.com/dotnet/sdk:8.0.302-bookworm-slim-arm64v8
) containing PowerShell v7.4.2.Expected behavior
Actual behavior
Environment data
The text was updated successfully, but these errors were encountered: