Open rkeithhill-keysight opened 10 months ago
Hmm,
> Get-SecretVault | fl *
Name : BuiltInLocalVault
ModuleName : SecretManagement.JustinGrote.CredMan
ModulePath : C:\Program Files (x86)\Universal\Modules\SecretManagement.JustinGrote.CredMan
Description :
VaultParameters : {}
IsDefault : False
Name : LocalStore
ModuleName : Microsoft.PowerShell.SecretStore
ModulePath : C:\Users\hillr\Documents\PowerShell\Modules\Microsoft.PowerShell.SecretStore
Description :
VaultParameters : {}
IsDefault : True
Name : PSUSecretStore
ModuleName : Microsoft.PowerShell.SecretStore
ModulePath : C:\Users\hillr\OneDrive - Keysight
Technologies\Documents\PowerShell\Modules\Microsoft.PowerShell.SecretStore
Description :
VaultParameters : {}
IsDefault : False
OK, edited this file "$HOME\AppData\Local\Microsoft\PowerShell\secretmanagement\secretvaultregistry\vaultinfo"
to fix the bogus old (pre-OneDrive migration) path and now the annoying error is gone.
Thank you rkeithhill. I was receiving the same error. I had looked around for a few hours for the file which held the string to that path which was being used but which was no longer correct to reach the SecretStore module. And the "vaultinfo" file was where the data was.
It seems that, in your case and mine, the problem with the path to the SecretStore module occurred because, at some time point after installation of the Microsoft SecretStore, the path to the special \Documents\ (aka "MyDocuments") folder in Windows was changed, and the contents of the \Documents\ folder moved to the new location. So, the folder which contains the SecretStore module was moved to that new location.
And for the SecretStore, Microsoft had used an algorithm such that the path listed in the "vaultinfo" file contains a string which pointed to the location of the Documents special folder at the time of installation of the Microsoft SecretStore.
So, I suggest that, in the next version of SecretStore, Microsoft change the algorithm so that the path listed in the "vaultinfo" file will contain a string which points to the Documents special folder. That way the path can be found at runtime, rather than at installation of the SecretStore module.
Also, I'm hoping a future version of PowerShell moves modules out of Documents\PowerShell\Modules
into a $HOME\AppData\Local
folder. That would have prevented this problem from occurring.
Prerequisites
Steps to reproduce
I'm not sure how to reproduce this since this only happens on my work PC which has redirected my
~\Document\PowerShell
folder to a corporate OneDrive folder. SecretManagement/Store used to not give this error before my company forced this redirection. Note that the command still works but it is annoying getting this error spit out every time. Basically, all I have to do to get this error is:Get-SecretInfo
I've tried preloading the modules and I still get this error:
The preloaded modules were loading from:
Finally, my
$env:PSModulePath
is set to:I do not understand why there is an attempt to load from
C:\Users\hillr\Documents\PowerShell\Modules\
.Expected behavior
Actual behavior
Error details
Environment data
Version
1.1.2
Visuals
No response