Skip to content

Suggestion on updating PSD1 metadata when a module is renamed #19745

@kilasuit

Description

@kilasuit

Summary of the new feature / enhancement

Off the back of #19742 and also the upcoming rename of PowerShellGet I realised that one of the core issues with module renaming is that it can cause downstream issues when users are using Explicit Module Loading or Fully Qualified Module Names or even as part of their build or packaging process of modules as part of any scripts or modules, and may also impact others in other ways too.

I'd Propose a suggested additional property in the PSData part of the PSD1 file of ModuleAlias to enable simpler mitigation of issues like this going forward & reduce overall maintenance of build/release/production scripts & modules

This would then allow for easier module renames without breaking scripts as long as the engine would also be updated to check for this new property when autoloading modules or when Fully Qualified Module Names are used in scripts. It would also likely need additional work in PowerShellGet / PSResourceGet to enable downloading this from the gallery using the Alias

This would be a nice to have to resolve what is classifiable as a self inflicted accidental & avoidable problem, but as products names and scope of modules change this could be a worthwhile investment to make.

Proposed technical implementation details (optional)

No response

Edited 27th July 2023

Minor amendment - instead of using ModuleAlias in PSData within a manifest instead I'd suggest calling it PreviousModuleName as this could be used as suggested above for some redirection text for users.

Edited 29th July 2023

Please see this issue in PSResourceGet for a better direction than originally suggested

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-DeclinedThe proposed feature is declined.WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions