PowerShell / SecretStore

MIT License
156 stars 23 forks source link

Unable to find dependent module(s) (Microsoft.PowerShell.SecretManagement) #27

Closed fidelcasto closed 3 years ago

fidelcasto commented 3 years ago

I've installed the modules using the steps recommended here :

Install-Module Microsoft.PowerShell.SecretManagement -Force -AllowPrerelease Install-Module Microsoft.PowerShell.SecretStore -Force -AllowPrerelease

When running the second command, I receive an error message saying : Unable to find dependent module(s) (Microsoft.PowerShell.SecretManagement).

The installation also only works on PowerShell 7 since PowerShell 5.1 does not seem to have support for the -AllowPrerelease command even if the document states so.

Our workaround was to remove the -Force parameter on the second command (Install-Module Microsoft.PowerShell.SecretStore -AllowPrerelease) in order the be able to complete the installation.

PaulHigin commented 3 years ago

Unfortunately Install-Module does not work well with (these) modules that are prerelease and have dependencies. Hopefully this will be fixed with PSGetV3. Try uninstalling and retry without the -Force switch. I have had consistent success over all platforms with the following:

Install-Module Microsoft.PowerShell.SecretManagement -Repository PSGallery -AllowPrerelease
Install-Module Microsoft.PowerShell.SecretStore -Repository PSGallery -AllowPrerelease
Register-SecretVault -Name SecretStore -ModuleName Microsoft.PowerShell.SecretStore -DefaultVault
SteveL-MSFT commented 3 years ago

I think while SecretStore is in preview, we should remove the dependency on SecretManagement so we can avoid the "prerelease dependency" issue. At GA we should put back the dependency.

SydneyhSmith commented 3 years ago

SecretStore does require SecretManagement to work properly, but this issue we be resolved regardless once we move to a GA state for the modules so I will close the issue--thanks!