You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 22, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 22, 2026. It is now read-only.
Get-SecretInfo: The specified module '...\Microsoft.PowerShell.SecretStore' was not loaded because no valid module file was found in any module directory. #217
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:
Start new PowerShell session
Run Get-SecretInfo
I've tried preloading the modules and I still get this error:
I do not understand why there is an attempt to load from C:\Users\hillr\Documents\PowerShell\Modules\.
Expected behavior
I should see no error about the module file not being found.
Actual behavior
> Get-SecretInfoGet-SecretInfo: The specified module 'C:\Users\hillr\Documents\PowerShell\Modules\Microsoft.PowerShell.SecretStore' was not loaded because no valid module file was found in any module directory.Vault PSUSecretStore requires a password.Enter password:***********Name Type VaultName---- ---- ---------ApiDocsKey String PSUSecretStore
Error details
Exception : Type : System.IO.FileNotFoundException Message : The specified module 'C:\Users\hillr\Documents\PowerShell\Modules\Microsoft.PowerShell.SecretStore' was not loaded because no valid module file was found in any module directory. HResult : -2147024894TargetObject : C:\Users\hillr\Documents\PowerShell\Modules\Microsoft.PowerShell.SecretStoreCategoryInfo : ResourceUnavailable: (C:\Users\hillr\Docu…erShell.SecretStore:String) [Get-SecretInfo], FileNotFoundExceptionFullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.SecretManagement.GetSecretInfoCommandInvocationInfo : MyCommand : Get-SecretInfo ScriptLineNumber : 1 OffsetInLine : 1 HistoryId : 3 Line : Get-SecretInfo Statement : Get-SecretInfo PositionMessage : At line:1 char:1 + Get-SecretInfo + ~~~~~~~~~~~~~~ InvocationName : Get-SecretInfo CommandOrigin : InternalScriptStackTrace : at <ScriptBlock>, <No file>: line 13PipelineIterationInfo :
Environment data
Name Value
---------
PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
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.
Activity
rkeithhill-keysight commentedon Jan 11, 2024
Hmm,
rkeithhill-keysight commentedon Jan 11, 2024
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.QS8 commentedon Feb 23, 2024
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.
rkeithhill-keysight commentedon Feb 23, 2024
Also, I'm hoping a future version of PowerShell moves modules out of
Documents\PowerShell\Modulesinto a$HOME\AppData\Localfolder. That would have prevented this problem from occurring.