Closed DonPwrShellHunt closed 3 years ago
Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.
Yes, currently Register-SecretVault saves the full path of the ModuleName
you provide. It uses PowerShell module loading, so if you provide just a module name it will search for it using $env:PSModulePath
, or if you provide a full path/name it will just use that. But when it finds the module it saves the full path in the vault registry. If you change the location of the extension vault module, you have to re-register it.
While doing development on a SecretManagement extension, a different instance of my module kept getting imported into my session and executed, rather than the one I placed earlier in the $PSModulePath. I finally figured out that the ModulePath property was saved with my registered secret vault, and that instance had priority running.
I did an Unregister-SecretVault & Register-SecretVault, which reset the ModulePath based on $PSModulePath and solved the strange import behavior.
My mindset was that the Register-SecretVault was semi-permanent and would not have to be reissued periodically.
Of course, having discovered this behavior, hopefully I'll recognize the symptoms if it crops up again.