SecretManagement.1Password icon indicating copy to clipboard operation
SecretManagement.1Password copied to clipboard

Cannot store secret with Set-Secret

Open JonathanPitre opened this issue 1 year ago • 5 comments

Hi, I'm new to SecretManagement and I'm unsure if I'm doing something wrong but I can't save a new secret in my vault.

Here's what I did.

I have installed the 1Password Cli and authenticated with my account and then I ran the following commands:

Install-Module -Name Microsoft.PowerShell.SecretManagement, SecretManagement.1Password -Force
Import-Module -Name Microsoft.PowerShell.SecretManagement, SecretManagement.1Password -Force
Register-SecretVault -Name '1Password: SecretVault' `
    -ModuleName 'SecretManagement.1Password' `
    -VaultParameters @{AccountName = 'myaccount.1password.com'; OPVault = 'SecretVault' } `
    -AllowClobber
Set-Secret -Name 'Autopilot' -Vault "1Password: SecretVault" -SecureStringSecret "MySecureString"

All commands ran without errors but when I'm trying to retrieve the secret I just saved, I get an error saying the secret was not found.

Image

Thanks in advance for your help!

JonathanPitre avatar Mar 19 '25 17:03 JonathanPitre

@JonathanPitre, it is likely going to be a while before I can find the time to diagnose this. Sorry for the inconvenience.

cdhunt avatar Mar 20 '25 00:03 cdhunt

No worries I appreciate you taking the time to answer me. I'm just curious to see if others are also experiencing this issue.

JonathanPitre avatar Mar 20 '25 00:03 JonathanPitre

Hi @JonathanPitre,

Did you confirm that the vault "1Password: SecretVault" is the default vault within Microsoft Secret Management?

You can confirm it with the following command:

Get-SecretVault -Name "1Password: SecretVault"

The expected output should be:

Name                     ModuleName                 IsDefaultVault
----                     ----------                 --------------
1Password: SecretVault   SecretManagement.1Password True

Note above, the "True" value under the "IsDefaultVault" field name.

If your vault is not the default one, then you can try to get the secret providing the name of the vault as follows:

Get-Secret -Vault "1Password: SecretVault" -Name "Autopilot"

Ben-m-s avatar Apr 01 '25 15:04 Ben-m-s

OK, 1.0.1 is out the door thanks to @Ben-m-s. Let me know if that resolves your issue.

cdhunt avatar Apr 08 '25 17:04 cdhunt

Sorry for the late reply.

The issue persists even after the module update.

Image

JonathanPitre avatar May 07 '25 15:05 JonathanPitre