Skip to content

Expand the syntax for Module-Qualified commands to allow you to specify a specific version as well #8949

@kilasuit

Description

@kilasuit

When writing scripts that have potentially clashing Cmdlet/function/alias names it is recommended to use the Full Module-Qualified name like below

Microsoft.PowerShell.Core\ForEach-Object

Whilst this is an extremely useful feature, this has an issue with it only working with either the currently loaded version or the latest version of the module specifiec and as such this is perhaps a lingering aspect of the language that was never updated when v5 came out which supported Side by Side versions

Therefore I think it would be great if the following syntax would be able to be accepted and correctly parsed

PowerShellGet:1.6.0\Find-Module

This breaks down to

<moduleName>:<moduleVersion>\<CommandName>

The potential although limited use case for this is within scripts that have dependencies on modules that have interesting & weird differences between module versions

You can already load multiple versions of a module into the same session so this would enable script/module authors another method for diagnosing accidental breaking changes in a more typical side by side manner within the same session

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugWG-Languageparser, language semanticsWG-NeedsReviewNeeds a review by the labeled Working Group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions