-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Expand the syntax for Module-Qualified commands to allow you to specify a specific version as well #8949
Description
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-ObjectWhilst 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-ModuleThis 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