Cannot store secret with Set-Secret
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.
Thanks in advance for your help!
@JonathanPitre, it is likely going to be a while before I can find the time to diagnose this. Sorry for the inconvenience.
No worries I appreciate you taking the time to answer me. I'm just curious to see if others are also experiencing this issue.
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"
OK, 1.0.1 is out the door thanks to @Ben-m-s. Let me know if that resolves your issue.
Sorry for the late reply.
The issue persists even after the module update.