Invalid path for a versioned K/V secrets engine. See the API docs for the appropriate API endpoints to use

I tried to Set secret in hashicorp vault but throwing an error “Invalid path for a
versioned K/V secrets engine. See the API docs for the appropriate API endpoints to use.”

cmd which we are using :$vault = Get-Vault -Address http://127.0.0.1:8200 -Token hvs.OZVOKUNGBYIoMEx2hhfVmqP7

Set-Secret -VaultObject $vault -path kv/test -Secret @{value=“secret”}

The Vault KV secret engine is effectively two different secrets engines, that the user may choose between:

  • Unversioned, v1
  • Versioned, v2

The error indicates you are trying to use a v2 KV as if it was a v1 KV.

The more complex API of the v2 KV are a significant complexity that catches users out.

Beyond that, I am not familiar with the PowerShell you are using, so I am not able to give further suggestions.