Signing back into the Community for the first time? You'll need to reset your password to access your account.  Find out more.

Forum Discussion

Former Member's avatar
Former Member
2 years ago

op item edit removes " Character from Password

Hi,

i try to update an item password with 1Password Cli which has a " Character in it. This character is removed from password when the password is written to the vault. I've tried already some variations of passing the password to the CLI but unfortunately it does always remove all " characters from the password.

Any ideas or hints how to get i written correctly?

Regards
Stefan


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser:_ Not Provided

  • Former Member's avatar
    Former Member

    Hi,
    I've found a solution for the mentioned problem. What is strange is, that the behavior is different if you call op item edit in PowerShell 5, Powershell 7 or for example zsh on MacOS.

    In Powershell 5 it is required to Mask the " character with a \. I've came op with the following code that will handle that situation. Maybe it is useful for someone!

    $Password = 'T"e""s"t'

    If ($PSVersionTable.PSVersion.Major -le '5') {
    $Password = $Password.Replace('"','\"')
    }

    $Command = 'op item edit "{0}" ''password={1}''' -f $("TestItem", $Password)

    Invoke-Expression -Command $Command

    Kind regards
    Stefan

  • Dayton_ag's avatar
    Dayton_ag
    Icon for 1Password Team rank1Password Team

    Hi @hayduk thanks so much for sharing this workaround for Powershell 5.1! 😄