Skip to content
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

PSUseCompatibleCmdlets says Install-Module is not compatible with desktop-5.1.14393.206-windows #2052

Open
o-l-a-v opened this issue Jan 14, 2025 · 3 comments

Comments

@o-l-a-v
Copy link

o-l-a-v commented Jan 14, 2025

Steps to reproduce

Invoke-ScriptAnalyzer -ScriptDefinition 'Install-Module -Name ''Foo''' -Settings @{
    Rules = @{
        PSUseCompatibleCmdlets = @{
            Compatibility = @('desktop-5.1.14393.206-windows')
        }
    }
} | Format-List -Property '*'

Expected behavior


Actual behavior

Line                 : 1
Column               : 1
Message              : 'Install-Module' is not compatible with PowerShell edition 'desktop', version '5.1.14393.206' and OS 'windows'
Extent               : Install-Module
RuleName             : PSUseCompatibleCmdlets
Severity             : Warning
ScriptName           : 
ScriptPath           : 
RuleSuppressionID    : 
SuggestedCorrections : 
IsSuppressed         : False

If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *

Environment data

  • PowerShell v7.4.6 x64 on Windows 11 24H2 x64
  • PSScriptAnalyzer v1.23.0
@o-l-a-v o-l-a-v changed the title PSSA says Install-Module is not compatible with desktop-5.1.14393.206-windows PSUseCompatibleCmdlets says Install-Module is not compatible with desktop-5.1.14393.206-windows Jan 14, 2025
@bergmeister
Copy link
Collaborator

This definitely sounds like a bug. Those files are checked in here, if you compare them to others you might be able to figure out how

@o-l-a-v
Copy link
Author

o-l-a-v commented Mar 13, 2025

Those haven't been updated in years, 9 years for the 5.1 one. Are they hand crafted, or programmatically generated somehow?

If they are not created and kept up to date programmatically they should not exist IMO, as they will not likely be correct / complete.

@bergmeister
Copy link
Collaborator

Those haven't been updated in years, 9 years for the 5.1 one. Are they hand crafted, or programmatically generated somehow?

If they are not created and kept up to date programmatically they should not exist IMO, as they will not likely be correct / complete.

They are generated by running this script. Results depend a bit on what one has installed, in the past I've tried to use a fresh new default system that mirrors what most people have installed (e.g. some module have to be enabled via Windows features)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants