cdhunt / SecretManagement.1Password

This is a SecretManagement extension for 1Password.
MIT License
22 stars 14 forks source link

Get-Secret fails to return password - fields argument cannot contain spaces #7

Closed DonPwrShellHunt closed 3 years ago

DonPwrShellHunt commented 3 years ago
 $item = & op get item $Name --fields username, password --vault $VaultName 2>$null | ConvertFrom-Json -AsHashtable
    # fields argument contains a space before password causing the op command to not return password field
    [securestring]$secureStringPassword = ConvertTo-SecureString $item.password -AsPlainText -Force

Since $item.password does not exist in returned hashtable, the ConvertTo-SecureString fails

cdhunt commented 3 years ago

Fixed in 3653ed1cc15a3afc4e153f260cde725c8ce4c466.

DonPwrShellHunt commented 3 years ago

Get-Secret works for me now. Tested Get-Secret for both Login & Password categories on Mac. Thanks