SecretStore icon indicating copy to clipboard operation
SecretStore copied to clipboard

Do we need to store the ModulePath in the vaultinfo file?

Open brwilkinson opened this issue 1 year ago • 1 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest released version
  • [X] Search the existing issues.

Steps to reproduce

cat $env:LOCALAPPDATA\Microsoft\PowerShell\secretmanagement\secretvaultregistry\vaultinfo

Do we have to store the ModulePath in the metadata file?

{
  "Vaults": {
    "SS": {
      "ModuleName": "Microsoft.PowerShell.SecretStore",
      "Description": "",
      "ModulePath": "C:\\Users\\myuser\\Documents\\PowerShell\\Modules\\Microsoft.PowerShell.SecretStore",
      "VaultParameters": {},
      "SetSecretSupportsMetadata": true
    }
  },
  "DefaultVaultName": "SS"
}
"ModulePath": "C:\\Users\\myuser\\OneDrive - Blah\\Documents\\PowerShell\\Modules\\Microsoft.PowerShell.SecretStore",

Expected behavior

I recently migrated from using documents in $home to documents in $env:OneDrive

then had to spend a bunch of time fixing the issue by unregistering and reregistering the secretvault.

Does the path really need to be in there?

Actual behavior

errors pointing to the old path that did not exist after the documents directory and modules directory was moved.

Error details

No response

Environment data

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.4
PSEdition                      Core

Version

1.1.2

Visuals

No response

brwilkinson avatar Aug 02 '24 05:08 brwilkinson

This could also occur if you switched module path from user to machine.

brwilkinson avatar Aug 03 '24 05:08 brwilkinson