question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion on updating PSD1 metadata when a module is renamed

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Reactions:3
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
JosephColvincommented, Jun 27, 2023

Thank you so much for this consideration and the insight shared. I appreciate the time, effort, and work that has been put into PowerShell. Thank you again!

Joseph Colvin

Message ID: @.***>

0reactions
JosephColvincommented, Aug 1, 2023

Thank you, Ryan, yet again, for sharing your knowledge with me {us?} as I did not know about this. I now will proceed to spend hours ‘googling’ how unique a GUID really is.

Joseph Colvin IT Coordinator Warwick Public Schoolhttps://www.warwick.k12.nd.us/

Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update-ModuleManifest (PowerShellGet) - PowerShell
The Update-ModuleManifest cmdlet updates a module manifest (.psd1) file.
Read more >
SharePoint2019Commands.psd1 0.1.1
Description = 'This module will help you auto-load all SharePoint 2019 cmdlets' # Minimum version of the Windows PowerShell engine required by this...
Read more >
How to Publish Your First PowerShell Gallery Package
psd1 file extension. The purpose of this manifest is to include additional information about the module, such as the author, other dependent ...
Read more >
Common messages troubleshooting Windows instances
A Windows instance must obtain information from its instance metadata before it can ... "C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psd1".
Read more >
Get-PowerShellBlog: March 2017
Update release notes with Version info and set the PSD1 release notes ... Update-Metadata -Path $env:BHPSModuleManifest -PropertyName ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found