The way to automate CLI signin in the powershell script

Options
fidelkodpua
fidelkodpua
Community Member

Hello!
I'm trying to automate CLI signin in the PowerShell script without having password prompt, but failing to do this..
I checked existing topics, but solutions described there do not work for me (or I'm doing something wrongly).
E.g. from this article: https://1password.community/discussion/90742/cli-authentication-without-intervention
I'm trying straightforward to execute simply test.ps1 file with this:

$PWD = "my_password"
Invoke-Expression $($PWD | op signin  )

and get an error (executed with admin permissions):

C:\projects\op> .\test.ps1
[ERROR] 2023/04/10 15:23:49 (401) Unauthorized: You aren't authorized to perform this action.
Invoke-Expression : Cannot bind argument to parameter 'Command' because it is null.
At C:\projects\op\test.ps1:11 char:19
Invoke-Expression $($PWD |  op signin  )

Could you please guide me to the best way of my task accomplishment?
Thank you in advance!


1Password Version: CLI
Extension Version: 2.14.0
OS Version: Win 10
Browser:_ Not Provided

This discussion has been closed.