d365collaborative / d365fo.tools

Tools used for Dynamics 365 Finance and Operations
MIT License
250 stars 102 forks source link

:sparkles: New cmdlet(s) for ModuleToRemove.txt to uninstall a package #710

Closed FH-Inway closed 1 year ago

FH-Inway commented 1 year ago

It would be nice to have cmdlets available that would make the process of uninstalling a package easier and automatable.

I propose two new cmdlets:

I'm also thinking about adding a parameter to Add-D365ModuleToRemove to provide module names so it can internally create the ModuleToRemove.txt file. This way the user would not have to work with two but just one cmdlet.

While researching this idea, I came upon How to add ModuleToRemove.txt to your package during MsDyn365FO build by @PaulHeisterkamp , which explores a similar idea and provides some PowerShell snippets to get started.

Splaxi commented 1 year ago

Awesome idea!

Let's make it happen 💪

FH-Inway commented 1 year ago

The existing cmdlet New-D365ISVLicense does basically the same thing as the proposed Add-D365ModuleToRemove cmdlet. I propose the logic gets refactored out into an internal function Add-FileToPackage, which could then be used by both cmdlets.

FH-Inway commented 1 year ago

Cmdlets New-D365ModuleToRemove and Add-D365ModuleToRemove are available as part of d365fo.tools starting with version 0.6.78.