Install-PSResource should restore if reinstall fails #498
Labels
Area-Install
Issue-Bug
Something isn't working
Resolution-Fixed
Fixed the issue in latest release or PR
Milestone
Prerequisites
Steps to reproduce
When I install the
Microsoft.PowerShell.SecretStore
extension vault module, Install-PSResource also tries to reinstall theMicrosoft.PowerShell.SecretManagement
module that it depends on, even though the-Reinstall
parameter switch is not used.However, the
Microsoft.PowerShell.SecretManagement
module is currently loaded and so the reinstall fails because it is a binary cmdlet and theMicrosoft.PowerShell.SecretManagement.dll
cannot be deleted.The result is the
Microsoft.PowerShell.SecretManagement
module is corrupted since all files are deleted except for the one binary.I feel a reinstall operation should not occur unless specifically specified by the user. Also, and if a reinstall fails we should have a fallback that restores the original installation.
The corruption occurs without any user error, so it is not apparent that SecretManagement is broken until the user tries running one of its commands.
Expected behavior
Actual behavior
Error details
Error occurs because all `Microsoft.PowerShell.SecretManagement` module files are deleted except for the binary file.
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: