Skip to content

missing SecretStore module install location causes error when accessing secrets #3911

@jonsequitur

Description

@jonsequitur

The file C:\Users\USERNAME\AppData\Local\Microsoft\PowerShell\secretmanagement\secretvaultregistry\vaultinfo contains the full path to the SecretStore module. In the case of .NET Interactive, the module is located inside the NuGet package. Here's an example of the contents of vaultinfo:

{
  "Vaults": {
    "DotnetInteractive": {
      "Description": "",
      "ModuleName": "Microsoft.PowerShell.SecretStore",
      "ModulePath": "C:\\Users\\USERNAME\\.nuget\\packages\\microsoft.dotnet-interactive\\1.0.617403\\tools\\net9.0\\any\\Modules\\Microsoft.PowerShell.SecretStore",
      "SetSecretSupportsMetadata": true,
      "VaultParameters": {}
    }
  },
  "DefaultVaultName": "DotnetInteractive"
}

If the indicated path doesn't exist on disk, storage and retrieval can fail, sometimes silently and sometimes with an error such as The specified module 'C:\Users\USERNAME\.nuget\packages\microsoft.dotnet-interactive\1.0.617403\tools\net9.0\any\Modules\Microsoft.PowerShell.SecretStore' was not loaded because no valid module file was found in any module directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions