interactive icon indicating copy to clipboard operation
interactive copied to clipboard

missing SecretStore module install location causes error when accessing secrets

Open jonsequitur opened this issue 10 months ago • 0 comments

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.

jonsequitur avatar Apr 11 '25 18:04 jonsequitur