Skip to content

Get-Module accepts nonsensical combinations of ModuleVersion and MaximumVersion entries for -FullyQualifiedName #7337

Description

Steps to reproduce

Request a minimum version of 1.6.0 and - nonsensically - a maximum version of 1.5.0:

Get-Module -ListAvailable -FullyQualifiedName @{ ModuleName='PowerShellGet'; ModuleVersion='1.6.0'; MaximumVersion='1.5.0' }

Expected behavior

I think a statement-terminating error indicating that MaximumVersion must be greater or equal to ModuleVersion (which uses minimum logic) would be more helpful than the current behavior.

If feasible, this validation should be tied to fully qualified module names themselves, wherever they are accepted.

Actual behavior

The argument is quietly accepted and therefore results in no output (because, by definition, no modules match).

Environment data

PowerShell Core v6.1.0-preview.3 on macOS 10.13.6
PowerShell Core v6.1.0-preview.3 on Ubuntu 16.04.4 LTS
PowerShell Core v6.1.0-preview.3 on Microsoft Windows 10 Pro (64-bit; Version 1803, OS Build: 17134.165)
\Windows PowerShell v5.1.17134.165 on Microsoft Windows 10 Pro (64-bit; Version 1803, OS Build: 17134.165)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PRIndicates that a PR is out for the issueIssue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreWG-Cmdletsgeneral cmdlet issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions