Faster way to retrieve multiple passwords at once

Andy2002aAndy2002a
edited June 8 in CLI

I'm trying to find the easiest/fastest way to retrieve multiple items with a password at once in PowerShell.

Right now I'm doing the following:

  • List all of the items in a vault
    • $All1PassItems += Invoke-Expression "$OnePassAppPath list items --vault $Vault 2>&1" | ConvertFrom-Json (this is fast)
  • Run a loop that retrieves the password for each item
    • $PWitems = Invoke-Expression "$OnePassAppPath get item $($ItemUUID) --fields username,password,notesPlain,title,url" -ErrorAction Stop | ConvertFrom-Json (this in a loop is slow)

This works well and it gives me what I need, but it's super slow because it has to run a query for each individual item. Is there a more efficient way to do this?


1Password Version:1.0
_Extension Version:
Not Provided
OS Version: Not Provided
Sync Type: Not Provided

Comments

  • felix_1pfelix_1p

    Team Member

    Not yet but there will be "soon" :smile: We are working on better support for pipelining so that e.g. you can pipe a list of items (or item UUIDs) to get item. You will be able to do something like op list items --vault <vault> | op get item - --fields .... So far our tests have shown big performance improvements compared to using a shell loop.

  • Andy2002aAndy2002a
    edited June 10

    Thanks! Is there any way to be notified when it is implemented?

  • felix_1pfelix_1p

    Team Member

    I'm happy to comment in this thread once it's implemented.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file